Is there a recommended way to implement a "remember this device" feature?
r
rp_st
11/08/2022, 5:17 AM
hey @garrett7056
rp_st
11/08/2022, 5:19 AM
By default, the session created by supertokens expires only due to inactivity equal to the refresh token's lifetime. So by default, the users can be logged in for a long period of time, if they are active.
That being said you can implement this feature by storing another token (a JWT for example) in the cookies which can be used has a fallback auth method in case the refresh token of the current session has expired.
Is there anything else you were looking for?
g
garrett7056
11/08/2022, 10:48 PM
Thanks @rp_st , I think we'll push this feature off for after release.
garrett7056
11/18/2022, 11:06 PM
I'm thinking about this feature now that we're live. I intend to implement it with a custom formField on at least the signIn custom form we have. Probably would also make sense on our email verify or signup, but one thing at a time. Is there a way to allow custom formFields on the signIn form similar to how it's done for the signUpFeature? I'm using the ThirdPArtyEmailPassword recipe.
Maybe I'm going about this wrong though 🤔
r
rp_st
11/19/2022, 3:34 AM
There is no custom form field in sign in yet. That being said, you should probably override the component to add a checkbox for remember me and read its value in sign in per api hook function on the frontend and send it to the backend as a custom field in the request
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).