nsarno / knock

Seamless JWT authentication for Rails API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Two different token expiries in a single application

7ail opened this issue · comments

Hi,

I just wanted to know if this gem handles multiple different expiry times for tokens.

In my case, we have a web portal and apps. We want to have the jwt token to expire in 1hr for the web portal but have it expiry in 30 days for the app.

From what I can gather, it seems that the config file only supports either or but not both. Some help/insight will be much appreciated

Regards
7ail

hey @7ail did you ever end up figuring this out?

@vcavallo yes we did, however it felt rather hacky. We decided to extend the knock gem and override the jwt token generation function to cater for our use case.

We left the 1 hour as a default value through the config file and whenever the jwt is generated through the mobile controllers, we utilise the overwritten jwt token generation function instead

Thank you. Closing this issue in favour of #241 which provide some extra details. Will consider supporting this in the future.