Fix payload reading null error
This commit is contained in:
@@ -13,6 +13,10 @@ export const handle: Handle = async ({ event, resolve }) => {
|
||||
return resolve(event);
|
||||
}
|
||||
const jwt = jws.decode(access_token.replace('Bearer ', ''));
|
||||
if (!jwt) {
|
||||
event.locals.email = null;
|
||||
return resolve(event);
|
||||
}
|
||||
// if token expires, do a request to get a new one and set the response-cookies on the response
|
||||
if (Date.now() >= jwt.payload.exp * 1000) {
|
||||
const res = await fetch(`${process.env.API_URL}/api/v1/users/check`, {
|
||||
|
||||
@@ -21,7 +21,7 @@ SPDX-License-Identifier: MPL-2.0
|
||||
navbarVisible.visible = true;
|
||||
|
||||
let { data } = $props();
|
||||
const { verified: boolean } = data;
|
||||
let { verified } = data;
|
||||
|
||||
let session_data = $state({});
|
||||
let step = $state(0);
|
||||
|
||||
Reference in New Issue
Block a user