Skip to content

Commit fc2a0e2

Browse files
author
sw-yx
committed
add nf jwt cookie
1 parent 1521c5b commit fc2a0e2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/runRoutes.tsx

+5-2
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ export function runRoutes(gotrue: GoTrue, setUser: (value: User) => User | undef
3030
const am = hash.match(accessTokenRoute)
3131
if (am) {
3232
const params = {}
33-
hash.split("&").forEach(pair => {
33+
hash.split("&").forEach((pair) => {
3434
const [key, value] = pair.split("=")
3535
params[key] = value
3636
})
37+
if (!!document && params["access_token"]) {
38+
document.cookie = `nf_jwt=${params["access_token"]}`
39+
}
3740
document.location.hash = ""
3841
// store.openModal("login");
3942
// store.completeExternalLogin(params);
@@ -46,7 +49,7 @@ export function runRoutes(gotrue: GoTrue, setUser: (value: User) => User | undef
4649
const cm = hash.match(confirmationRoute)
4750
if (cm) {
4851
const params = {}
49-
hash.split("&").forEach(pair => {
52+
hash.split("&").forEach((pair) => {
5053
const [key, value] = pair.split("=")
5154
params[key] = value
5255
})

0 commit comments

Comments
 (0)