enzostvs HF staff commited on
Commit
4cc6b33
1 Parent(s): d15b3be

token works in space

Browse files
Files changed (1) hide show
  1. 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: res.experes_in,
 
 
 
 
 
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