ui: Include next parameters in OIDC
This commit is contained in:
parent
bc03597dd4
commit
02ce694a35
19
ui/src/components/AuthButton.svelte
Normal file
19
ui/src/components/AuthButton.svelte
Normal 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>
|
@ -42,6 +42,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import AuthButton from '../components/AuthButton.svelte';
|
||||||
import Toaster from '../components/Toaster.svelte';
|
import Toaster from '../components/Toaster.svelte';
|
||||||
|
|
||||||
export let rroute = '';
|
export let rroute = '';
|
||||||
@ -129,9 +130,9 @@
|
|||||||
</li>
|
</li>
|
||||||
{:else}
|
{:else}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="auth/CRI" target="_self" class="btn btn-dark">
|
<AuthButton class="btn btn-dark">
|
||||||
Se connecter
|
Se connecter
|
||||||
</a>
|
</AuthButton>
|
||||||
</li>
|
</li>
|
||||||
{/if}
|
{/if}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import { page } from '$app/stores'
|
import { page } from '$app/stores'
|
||||||
|
|
||||||
|
import AuthButton from '../components/AuthButton.svelte';
|
||||||
|
|
||||||
let auth = { username: "", password: "" };
|
let auth = { username: "", password: "" };
|
||||||
let pleaseWait = false;
|
let pleaseWait = false;
|
||||||
|
|
||||||
@ -70,9 +72,9 @@
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<h2>OpenId Connect</h2>
|
<h2>OpenId Connect</h2>
|
||||||
<div class="text-center">
|
<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
|
Me connecter avec mon compte CRI
|
||||||
</a>
|
</AuthButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user