auth: Handle next parameters
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
nemunaire 2022-04-20 21:52:02 +02:00
parent 18eb7b4feb
commit e02d5073a8

View File

@ -12,10 +12,13 @@
<script>
import { goto } from '$app/navigation';
import { page } from '$app/stores'
let auth = { username: "", password: "" };
let pleaseWait = false;
export let next = $page.url.searchParams.get('next');
function logmein() {
pleaseWait = true;
fetch('api/auth', {
@ -26,7 +29,11 @@
response.json().then((auth) => {
pleaseWait = false;
$session = auth;
goto(".");
if (next && next.indexOf('//') === -1) {
goto(next)
} else {
goto(".");
}
})
})
.catch((response) => {