Keep user logged in

Hello everyone,

Is it possible to let users logged in for eg. 3 days ?

I’m using Xano as a back end :slight_smile:

Thank you!

Hello, I don’t think this is a good approach, since the sessions should expire at some point. You could send and store refresh tokens on the front-end in WeWeb and refresh the session in Xano probably.

Hello, thanks for your response.

We’re aiming to replicate the behavior we see when logging into our Stripe dashboard. For instance, even if the user is logged out, Stripe remembers that we logged in three days ago. This allows us to simply click “Sign In,” and the login process completes seamlessly.

I’ll explore your suggested strategy further and let you know how it goes.

Best regards,

Yes it is!

On Xano, check the “auth/login” endpoint. On the “Create authentication token” function, you can specify expiration in seconds.

Default is 86400 (24h).
You can change it to 259200 (3 days).

Also, although questionable you are free to change authentication logic inside the API.
You’re not even tecnically required to check the passwords before issuing authentication tokens. Not that you should do it, but you could even implement some sort of magic link login logic with that.

1 Like

Nice! That was what i was looking for :slight_smile:
Thank you !