Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
wip signin
Browse files
src/routes/login/callback/+page.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import cookies from "js-cookie";
|
2 |
-
|
3 |
export async function load({ url, fetch }) {
|
4 |
const code = url.searchParams.get("code")
|
5 |
|
@@ -12,7 +12,7 @@ export async function load({ url, fetch }) {
|
|
12 |
const { ok, token } = await request.json();
|
13 |
if (ok) {
|
14 |
cookies.set("hf_access_token", token, { expires: 1, domain: process.env.SPACE_HOST });
|
15 |
-
|
16 |
}
|
17 |
}
|
18 |
|
|
|
1 |
import cookies from "js-cookie";
|
2 |
+
import { redirect } from "@sveltejs/kit";
|
3 |
export async function load({ url, fetch }) {
|
4 |
const code = url.searchParams.get("code")
|
5 |
|
|
|
12 |
const { ok, token } = await request.json();
|
13 |
if (ok) {
|
14 |
cookies.set("hf_access_token", token, { expires: 1, domain: process.env.SPACE_HOST });
|
15 |
+
throw redirect(302, "/")
|
16 |
}
|
17 |
}
|
18 |
|