-
Notifications
You must be signed in to change notification settings - Fork 25
Description
Hi all,
At the risk of asking a duplicated question, does anyone have a flow using Hoodie that allows for offline multi-user authentication?
I am developing an app that needs to allow a user in when they are offline, and I'm just wondering how best to do this?
The flow I have at the moment in my head is:
- A new user signs up. This will only ever work when online
- The new user signs into the app (still online). Hoodie does its thing and returns some token/cookie which then gets stored on the device / backend DB.
Next day
3. user signs into the app again. Hoodie checks the connection state, sees that we are offline, and therefore uses the saved user token and lets the user in. If no token exists, of the token is invalid, the user is denied.
My questions with this though are:
-
Should I be storing a token on the client or in a DB on the backend?
-
How does Hoodie authenticate the token is valid / not expired / password correct / user exists etc. when offline?
Thanks
Peter