2020-05-28 11:29:21 -04:00
|
|
|
<script>
|
2020-05-28 12:39:48 -04:00
|
|
|
import { Highlight } from 'svelte-highlight';
|
|
|
|
|
import { json } from 'svelte-highlight/languages';
|
|
|
|
|
import { arduinoLight as highlightTheme } from "svelte-highlight/styles";
|
2020-05-28 11:29:21 -04:00
|
|
|
import {
|
|
|
|
|
OidcContext,
|
|
|
|
|
authError,
|
|
|
|
|
idToken,
|
|
|
|
|
accessToken,
|
|
|
|
|
isAuthenticated,
|
|
|
|
|
isLoading,
|
|
|
|
|
login,
|
|
|
|
|
logout,
|
|
|
|
|
userInfo,
|
|
|
|
|
} from './components/components.module.js';
|
|
|
|
|
</script>
|
|
|
|
|
|
2020-05-28 12:39:48 -04:00
|
|
|
<svelte:head>
|
|
|
|
|
{@html highlightTheme}
|
|
|
|
|
</svelte:head>
|
|
|
|
|
|
2020-05-28 11:29:21 -04:00
|
|
|
<div class="container">
|
|
|
|
|
<OidcContext
|
|
|
|
|
issuer="process.env.OIDC_ISSUER"
|
|
|
|
|
client_id="process.env.OIDC_CLIENT_ID"
|
|
|
|
|
redirect_uri="process.env.OIDC_REDIRECT_URI"
|
|
|
|
|
post_logout_redirect_uri="process.env.OIDC_POST_LOGOUT_REDIRECT_URI"
|
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
<button class="btn" on:click|preventDefault='{() => login() }'>Login</button>
|
|
|
|
|
<button class="btn" on:click|preventDefault='{() => logout() }'>Logout</button>
|
|
|
|
|
<table>
|
|
|
|
|
<thead>
|
|
|
|
|
<tr><th style="width: 20%;">store</th><th style="width: 80%;">value</th></tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr><td>isLoading</td><td>{$isLoading}</td></tr>
|
|
|
|
|
<tr><td>isAuthenticated</td><td>{$isAuthenticated}</td></tr>
|
|
|
|
|
<tr><td>accessToken</td><td>{$accessToken}</td></tr>
|
|
|
|
|
<tr><td>idToken</td><td style="word-break: break-all;">{$idToken}</td></tr>
|
2020-05-28 12:39:48 -04:00
|
|
|
<tr><td>userInfo</td><td><Highlight language={json} code={JSON.stringify($userInfo, null, 2) || ''} /></td></tr>
|
2020-05-28 11:29:21 -04:00
|
|
|
<tr><td>authError</td><td>{$authError}</td></tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</OidcContext>
|
|
|
|
|
</div>
|