Hey, is it possible to add "temporary" roles to an user ? We would like to be able to add "super-user" role to a user that is only valid for 30 min for example. How would you do this ? Thanks!
r
rp_st
01/31/2023, 2:51 PM
hey @hhchift yes and no.
rp_st
01/31/2023, 2:52 PM
We do not have the concept of temporary roles, but you can add a role and then setup a cron job on your end to remove the role later on
h
hhchift
01/31/2023, 6:56 PM
thanks @rp_st
hhchift
01/31/2023, 6:56 PM
is it possible to see the date when a role was added ?
hhchift
01/31/2023, 6:57 PM
I could then for example on session creation remove all "such" roles ...
r
rp_st
01/31/2023, 7:02 PM
Hmmm. That’s interesting. We don’t store that info at the moment. So you would need to store that info yourself in your own db perhaps.
rp_st
01/31/2023, 7:02 PM
Or you could also use the user metadata feature to store that info where the “userId” is the role string, and the associated json contains the created time
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).