I could give you a few scenarios.
For one-off actions, they are easier to implement and maintain than fully-fledged pages. No need to worry about routing, history or back button.
For example, we offer authentication via a modal, with multiple options.
By tapping login, a modal is shown with the auth choices. This is helpful since the login modal can be opened from a drawer, regardless of what page the user is on. (or pop up when an action requires auth).
1 - On a passwordless auth flow, a user tries to login via email, so another modal asks for email. Once the email is sent, a third modal shows on top of it, asking for a code. We cannot close the previous ones yet, as the user might not get the code in time or whatever, so they can request a new one without starting over. Once they enter the code and are authenticated, all modals (3) get dismissed
ā Login/Email/Code
2 - Same goes with a Google login. We merge multiple accounts based on email matches, so we show a modal to the user when there is a clash, again asking to confirm their identity by entering a code we sent by email. Once the user does that, both modals get dismissed.
ā Login/Confirmation Code
3 - Same as 2, but if the user is an admin, they need to confirm their admin credentials. On success, both modals get dismissed
ā Login/Confirm Credentials.
The authentication is always performed on top of what page the user is on, to avoid disruption of what they are doing.
Anyway, it looks like id
is not available so we will write our own modalsHandler
component.
Thanks