ui: Include next parameters in OIDC

This commit is contained in:
nemunaire 2022-05-15 12:34:19 +02:00
parent bc03597dd4
commit 02ce694a35
3 changed files with 27 additions and 5 deletions

View File

@ -0,0 +1,19 @@
<script>
import { page } from '$app/stores';
let className = '';
export { className as class };
let auth_route = 'auth/CRI'
$: {
if ($page.url.searchParams.get('next')) {
auth_route = 'auth/CRI?next=' + encodeURIComponent($page.url.searchParams.get('next'));
} else {
auth_route = 'auth/CRI?';
}
}
</script>
<a href={auth_route} target="_self" class="{className}">
<slot></slot>
</a>

View File

@ -42,6 +42,7 @@
</script>
<script>
import AuthButton from '../components/AuthButton.svelte';
import Toaster from '../components/Toaster.svelte';
export let rroute = '';
@ -129,9 +130,9 @@
</li>
{:else}
<li class="nav-item">
<a href="auth/CRI" target="_self" class="btn btn-dark">
<AuthButton class="btn btn-dark">
Se connecter
</a>
</AuthButton>
</li>
{/if}
</ul>

View File

@ -14,6 +14,8 @@
import { goto } from '$app/navigation';
import { page } from '$app/stores'
import AuthButton from '../components/AuthButton.svelte';
let auth = { username: "", password: "" };
let pleaseWait = false;
@ -70,9 +72,9 @@
<div class="col">
<h2>OpenId Connect</h2>
<div class="text-center">
<a href="auth/CRI" class="btn btn-primary" target="_self">
<AuthButton class="btn btn-primary">
Me connecter avec mon compte CRI
</a>
</AuthButton>
</div>
</div>
</div>