Skip to content

Commit

Permalink
Renamed landing page; removed link to homepage; Revised copy
Browse files Browse the repository at this point in the history
  • Loading branch information
jsernaque committed Aug 9, 2024
1 parent 04d0d77 commit 7c09d16
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion examples/token-auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This project demonstrates how Token Auth works with Edgio. For more details on t
This application exposes a few separate pages and one API endpoint:

* Main Page `/`: This page does not require an auth token.
* Secure Pages Landing Page `/secure`: This page does not require an auth token. All links on this page (except for the link to the homepage) DO require a valid token.
* Token Auth Landing Page `/secure`: This page does not require an auth token. All links on this page (except for the link to the homepage) DO require a valid token.
* Static Secure Page `/secure/static`: This page shows static data.
* Static Dynamic Page `/secure/dynamic`: This page shows dynamic data fetched from a third-party API.
* Token Generator/Decoder `/secure/generator`: This page allows the visitor to create and decode `ectoken`-compatible tokens.
Expand Down
2 changes: 1 addition & 1 deletion examples/token-auth/src/app/secure/dynamic/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default async function SecurePage__Dynamic() {
<pre className="mt-4">
{JSON.stringify(weatherData, null, 2)}
</pre>
<p className="mt-4"><TokenAwareLink className="underline text-slate-400 hover:text-slate-800" href="/secure">Return to the Secure Pages landing page.</TokenAwareLink></p>
<p className="mt-4"><TokenAwareLink className="underline text-slate-400 hover:text-slate-800" href="/secure">Return to the Token Auth landing page.</TokenAwareLink></p>
</Suspense>
)
}
2 changes: 1 addition & 1 deletion examples/token-auth/src/app/secure/generator/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export default function SecurePage__Generator() {
</fieldset>
</form>

<p className="mt-4"><TokenAwareLink className="underline text-slate-400 hover:text-slate-800" href="/secure">Return to the Secure Pages landing page.</TokenAwareLink></p>
<p className="mt-4"><TokenAwareLink className="underline text-slate-400 hover:text-slate-800" href="/secure">Return to the Token Auth landing page.</TokenAwareLink></p>
</Suspense>
)
}
2 changes: 1 addition & 1 deletion examples/token-auth/src/app/secure/info/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function SecurePage__InfoComponent() {
</div>
</div>

<p className="mt-4"><TokenAwareLink className="underline text-slate-400 hover:text-slate-800" href="/secure">Return to the Secure Pages landing page.</TokenAwareLink></p>
<p className="mt-4"><TokenAwareLink className="underline text-slate-400 hover:text-slate-800" href="/secure">Return to the Token Auth landing page.</TokenAwareLink></p>
</>
)
}
Expand Down
16 changes: 7 additions & 9 deletions examples/token-auth/src/app/secure/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,22 @@ export default function SecurePage() {

return (
<>
<h1 className="text-xl font-bold">Landing Page</h1>
<h1 className="text-xl font-bold">Token Auth Landing Page</h1>
<p>The following pages are protected by Token Auth:</p>
<ul className="mt-2 list-disc list-inside ml-3">
<li><Link className="underline text-slate-400 hover:text-slate-800" href={`/secure/static${token ? `?${token}` : ''}`}>Static page</Link></li>
<li><Link className="underline text-slate-400 hover:text-slate-800" href={`/secure/dynamic${token ? `?${token}` : ''}`}>Dynamic page</Link></li>
<li><Link className="underline text-slate-400 hover:text-slate-800" href={`/secure/generator${token ? `?${token}` : ''}`}>Client-side Token Generator/Decoder</Link></li>
<li><Link className="underline text-slate-400 hover:text-slate-800" href={`/secure/info${token ? `?${token}` : ''}`}>Decode the token used to access this page (requires secret key)</Link></li>
<Link className="underline text-slate-400 hover:text-slate-800" href="/">Return to the homepage.</Link>
<li><Link className="underline text-slate-400 hover:text-slate-800" href={`/secure/static${token ? `?${token}` : ''}`}>Sample static page</Link></li>
<li><Link className="underline text-slate-400 hover:text-slate-800" href={`/secure/dynamic${token ? `?${token}` : ''}`}>Sample dynamic page</Link></li>
<li><Link className="underline text-slate-400 hover:text-slate-800" href={`/secure/generator${token ? `?${token}` : ''}`}>Generate and decode custom tokens</Link></li>
<li><Link className="underline text-slate-400 hover:text-slate-800" href={`/secure/info${token ? `?${token}` : ''}`}>Decode the token used to access this page.</Link></li>
</ul>
<p className="mt-4">Need a token to get started? Click the button below to generate one.</p>
<p className="mt-4">Generate a temporary token to access the above pages.</p>
<button
onClick={handleTokenClick}
className="mt-2 p-3 rounded-md border-gray-300 shadow-sm bg-white dark:bg-slate-500 hover:bg-gray-50 dark:hover:bg-gray-800 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"
>
Generate a temporary token
Generate Token
</button>
{token !== '' && (<p className="mt-4">Use <code className="bg-slate-100 dark:bg-slate-700 p-1 rounded-lg border-2">{token}</code>. It's valid for 3 minutes from the time it was generated. The links above have been updated with that token.</p>)}
<p><Link className="underline text-slate-400 hover:text-slate-800" href="/">Return to the homepage.</Link></p>
</>
)
}
2 changes: 1 addition & 1 deletion examples/token-auth/src/app/secure/static/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default function SecurePage__Static() {
<>
<h1 className="text-xl font-bold">Secure Static Page</h1>
<p>If you're seeing this message, congratulations! Your token is working properly.</p>
<p className="mt-4"><Link className="underline text-slate-400 hover:text-slate-800" href="/secure">Return to the Secure Pages landing page.</Link></p>
<p className="mt-4"><Link className="underline text-slate-400 hover:text-slate-800" href="/secure">Return to the Token Auth landing page.</Link></p>
</>
)
}

0 comments on commit 7c09d16

Please sign in to comment.