Skip to content

Commit 4e89a9d

Browse files
committed
fix: add message to forbiben error when jwt expired
1 parent f4fc71f commit 4e89a9d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/controllers/auth.controller.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ class AuthController {
148148
const tokens = this.getNewTokens({ id: user.id, sid: newSid.id })
149149

150150
res.json(tokens)
151-
} catch {
151+
} catch (e) {
152+
if (e instanceof Error) return next(Forbidden(e.message))
153+
152154
return next(Forbidden())
153155
}
154156
}

0 commit comments

Comments
 (0)