Skip to content

Commit 43eb9cc

Browse files
authored
Merge pull request #15 from ercfermi/token-expiry-to-allow-re-signing
Update auth.global.ts
2 parents 1b24a3d + 6364b42 commit 43eb9cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

frameworks/nuxt/oidc-client-ts/middleware/auth.global.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
88
const services = useServices();
99
const user = (await services.$auth.getUser()) as User;
1010

11-
if (!user && !authFlowRoutes.includes(to.path)) {
11+
if ((!user || user.expired) && !authFlowRoutes.includes(to.path)) {
1212
// use this to automatically force a sign in and redirect
1313
// services.$auth.signInRedirect();
1414
} else {

0 commit comments

Comments
 (0)