fixed callback url

This commit is contained in:
ari melody 2024-06-29 19:52:52 +01:00
parent 509a817065
commit 71a95c92db
Signed by: ari
GPG key ID: CF99829C92678188
7 changed files with 32 additions and 22 deletions

View file

@ -0,0 +1 @@
<slot/>

View file

@ -0,0 +1,20 @@
import { Client } from '$lib/client/client.js';
import { goto } from '$app/navigation';
import { error } from '@sveltejs/kit';
import { get } from 'svelte/store';
export const ssr = false;
export async function load({ params, url }) {
const client = get(Client.get());
let auth_code = url.searchParams.get("code");
if (auth_code) {
client.getToken(auth_code).then(() => {
client.save();
goto(url.origin);
});
}
error(400, {
message: "Bad request"
});
}

View file