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
I am using NestJS with the passport-jwt Strategy and have set ignoreExpiration to false. However, is it possible to set it to true only for the JWT refresh endpoint? I thought of adding a custom annotation/decorator (@JWTIgnoreExpiration()) to my refresh endpoint, but I don't know how I can address ignoreExpiration then. Is this possible with passport-jwt?
Alternative would be to set ignoreExpiration to true and check it manually in a NestJS guard, however then I had to check the iat and exp by hand and not by the official jwtService.verify function.
The text was updated successfully, but these errors were encountered:
Alwinator
changed the title
How to ignore ignoreExpiration in specific endpoint?
How to ignore ignoreExpiration for a specific endpoint?
May 19, 2022
I found a workaround: Add two passport-jwt strategies, one with ignoreExpiration true and one with false and then use the correct one on the refresh route using @UseGuards()
I am using NestJS with the passport-jwt Strategy and have set
ignoreExpiration
tofalse
. However, is it possible to set it totrue
only for the JWT refresh endpoint? I thought of adding a custom annotation/decorator (@JWTIgnoreExpiration()
) to my refresh endpoint, but I don't know how I can addressignoreExpiration
then. Is this possible with passport-jwt?Alternative would be to set
ignoreExpiration
totrue
and check it manually in a NestJS guard, however then I had to check the iat and exp by hand and not by the official jwtService.verify function.The text was updated successfully, but these errors were encountered: