Fix client-side errors
This commit is contained in:
@@ -9,7 +9,6 @@ function getClaimsFromToken(token) {
|
|||||||
try {
|
try {
|
||||||
return jwtDecode(token);
|
return jwtDecode(token);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Invalid token:', error);
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,7 +26,7 @@ export const useAuthStore = defineStore(
|
|||||||
|
|
||||||
const userId = computed(() => {
|
const userId = computed(() => {
|
||||||
const claims = getClaimsFromToken(accessToken.value)
|
const claims = getClaimsFromToken(accessToken.value)
|
||||||
return claims.sub;
|
return claims?.sub;
|
||||||
})
|
})
|
||||||
|
|
||||||
function updateTokens(data) {
|
function updateTokens(data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user