'Gin-JWT Dynamically set token Timeout based on user

Using Gin-JWT within my Go project I'm having difficulty dynamically setting the token timeout based upon which user logs in via the LoginHandler. e.g. user A requires a 10-minute timeout while user B requires a 60-minute timeout. Based upon the user passed to the LoginHandler I need to do a lookup and set the token Timeout. Any help is appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source