#Long lived JWT

35 messages · Page 1 of 1 (latest)

solid junco
#

I see here that if I create a JWT it will only live for 15 minutes. https://appwrite.io/docs/references/cloud/client-apple/account#createJWT

My app will be used offline for up to 12 hours and I need to be able to allow the user to still use it even if they can't be online.

My idea would be to have the user sign in and then set a token for a day or two and then once it expires lock them out and force them to sign back in.

I'm definately open to any ideas on how to achieve my goal.

The Account service allows you to authenticate and manage a user account. You can use the account service to update user information, retrieve the user sessions across different devices, and fetch the user security logs with his or her recent activity.

Register new user accounts with the [Create Account](/docs/references/cloud/client-web/accoun...

upbeat ingot
upbeat ingot
solid junco
#

I saw that you guys set two cookies in my browser when i login. So i logged in and then turned off my wifi and then tried to refresh the page and then the cookies were removed. Is this the same behavior on swift sdk?

upbeat ingot
solid junco
#

I had the cookies section open on my browser and saw them disappear

#

Do you want me to send a video?

upbeat ingot
upbeat ingot
solid junco
#

ok so i have an internet connection - i refresh the page and see this

#

i then turn off my wifi and refresh the page and they are gone

upbeat ingot
solid junco
#

what am i looking for there?

upbeat ingot
solid junco
#

for me as the user?

upbeat ingot
solid junco
#

Which section of chrome dev tools?

upbeat ingot
solid junco
upbeat ingot
solid junco
#

Yes

#

But when I refresh the page after I turn off wifi they disappear

#

I can send a short screen recording if needed

upbeat ingot
#

The point is they're still in the browser

solid junco
#

See above for what I’m seeing

solid junco
#

i see that this persists in localstorage during a page refresh while i have no internet

#

once i turn the wifi back on and refresh the page i am logged back in

#

is there a way to locally verify that cookie via a public / private key type of deal

#

my setup is that i want a user to signup / login with oauth2 provider (amazon for example) and then setup a subscription via stripe - at this point they are free to go offline for some set time limt (2 weeks for example) and they should be able to use the app - but after the time limit i will force them to go backonline and reauthenticate or ill call out to appwrite for a refresh token

#

and the offline use of my app pertains to using my ios app and maybe later an android app

upbeat ingot