You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jwt token expire and Invalid credential both case error meassage same
so, how i can differentiate token expire or invalid
verify token for jsonweb token he give error for expire token either invalide token
Problem:
return reply(raiseError('unauthorized',
'Invalid token', tokenType), null, { credentials: null });
verify token for jsonweb token he give error for expire token either invalide token
solution:
if (verify_err.name == "TokenExpiredError") {
return reply(raiseError(verify_err.name,
verify_err.message, verify_err.expiredAt, verify_err.payload), null, {credentials: null}).code(440);
} else {
return reply(raiseError(verify_err.name,
verify_err.message, verify_err.expiredAt, verify_err.payload), null, {credentials: null}).code(498);
}
The text was updated successfully, but these errors were encountered:
Jwt token expire and Invalid credential both case error meassage same
so, how i can differentiate token expire or invalid
verify token for jsonweb token he give error for expire token either invalide token
Problem:
return reply(raiseError('unauthorized',
'Invalid token', tokenType), null, { credentials: null });
verify token for jsonweb token he give error for expire token either invalide token
solution:
if (verify_err.name == "TokenExpiredError") {
return reply(raiseError(verify_err.name,
verify_err.message, verify_err.expiredAt, verify_err.payload), null, {credentials: null}).code(440);
} else {
return reply(raiseError(verify_err.name,
verify_err.message, verify_err.expiredAt, verify_err.payload), null, {credentials: null}).code(498);
}
The text was updated successfully, but these errors were encountered: