Spaces:
Runtime error
Runtime error
token works in space
Browse files- utils/useUser.ts +6 -1
utils/useUser.ts
CHANGED
@@ -64,7 +64,12 @@ export const useUser = () => {
|
|
64 |
const res = await request.clone().json().catch(() => ({}));
|
65 |
if (!res.ok) return
|
66 |
setValue(res.access_token, {
|
67 |
-
expires:
|
|
|
|
|
|
|
|
|
|
|
68 |
});
|
69 |
}
|
70 |
|
|
|
64 |
const res = await request.clone().json().catch(() => ({}));
|
65 |
if (!res.ok) return
|
66 |
setValue(res.access_token, {
|
67 |
+
expires: new Date(
|
68 |
+
res.experes_in * 1000 + new Date().getTime()
|
69 |
+
),
|
70 |
+
path: "/",
|
71 |
+
sameSite: "none",
|
72 |
+
httpOnly: true,
|
73 |
});
|
74 |
}
|
75 |
|