Kicking users to login screen based on state? #1805
-
I've been spending a lot of time thinking on how to handle login \ authentication for my app and was curious how everyone is handling these scenarios:
Given this can happen from almost anywhere, how do you all handle it? Do you wait for them to relaunch the app and just keep returning access denied on the API layer? Is there a way for the state to invoke a dump-all function and take them back to the main screen? My worry is that in the latter option, I would need each store that calls the API to be aware of the bad API response which seems really cumbersome. It may be better just to show a login screen on app boot and restore state or attempt to validate and go from there? How are you handling it in your apps? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @WalrusSoup! Good question. From a user experience standpoint, it makes sense to show a screen (modal or otherwise) that indicates they've been logged out and need to log in again. Something like how Gmail will show you an intermediate screen when you've been logged out. We often have an API service object (see this: ignite/boilerplate/app/services/api/api.ts Lines 55 to 58 in ef5810a |
Beta Was this translation helpful? Give feedback.
Hey @WalrusSoup! Good question.
From a user experience standpoint, it makes sense to show a screen (modal or otherwise) that indicates they've been logged out and need to log in again. Something like how Gmail will show you an intermediate screen when you've been logged out.
We often have an API service object (see this:
ignite/boilerplate/app/services/api/api.ts
Lines 55 to 58 in ef5810a