Hey! Unfortunately no. You need to change this on the core side
u
ulys3556
10/10/2022, 1:05 PM
thanks !
r
rp_st
10/10/2022, 1:27 PM
is there an issue with doing that? Some use case in which it's causing a problem?
u
ulys3556
10/10/2022, 1:38 PM
A 'nice to have' feature for us was to be able to set a custom timeout per user (based on user role or metadata)
r
rp_st
10/10/2022, 1:40 PM
hmm. You can hack your way around this. Here is what you can do:
- Set the custom time you need in the access token payload for that user.
- Create your own wrapper middleware around verifySession which calls verifySession, and then checks if the time has passed that custom time in the access token payload.
- If it hasn't, then you can call the actual API.
- If it has, call session.revoke(), and then send a 401 to the frontend. The frontend will try and refresh which will fail, logging out the user.
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).