fixed callback url
This commit is contained in:
parent
509a817065
commit
71a95c92db
7 changed files with 32 additions and 22 deletions
1
src/routes/callback/+layout.svelte
Normal file
1
src/routes/callback/+layout.svelte
Normal file
|
@ -0,0 +1 @@
|
|||
<slot/>
|
20
src/routes/callback/+page.js
Normal file
20
src/routes/callback/+page.js
Normal 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"
|
||||
});
|
||||
}
|
0
src/routes/callback/+page.svelte
Normal file
0
src/routes/callback/+page.svelte
Normal file
Loading…
Add table
Add a link
Reference in a new issue