gitcommitshow
04/30/2022, 6:42 PMverifySession
middleware.
When the token is expired, it sends 401 response with json response {"message":"try refresh token"}
.
Instead of this, I want to send an html page.
So I decided to use onUnAuthorised
event in SuperTokens node sdk.
Session.init({
errorHandlers: {
onUnauthorised: async (message, request, response) => { console.log(message);
// But this didn't print anything
},
....
To test the fn, I logged but I didn't see anything printed in console.
1. Am I using 'onUnAuthorised' event correctly?
2. Is 'onUnAuthorised` event the correct place to override the behaviour on token expiry? Do we have any example or reference for this event?