diff --git a/EXAMPLES.md b/EXAMPLES.md index d7390b16..c90b85ab 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -341,8 +341,10 @@ In the case of signup, you can add [an additional parameter](https://auth0.com/d auth0.webAuth.authorize({ connection: realm, scope: scope, - login_hint: email, - screen_hint: 'signup', // 👈🏻 + additionalParameters: { + login_hint: email, + screen_hint: 'signup', // 👈🏻 + }, }); ``` diff --git a/FAQ.md b/FAQ.md index bea4bb7f..0ca4fa24 100644 --- a/FAQ.md +++ b/FAQ.md @@ -11,6 +11,7 @@ 9. [How can I prevent the autogenerated redirect_uri from breaking if the applicationId has mixed cases or special characters in it on Android?](#9-how-can-i-prevent-the-autogenerated-redirect_uri-from-breaking-if-the-applicationId-has-mixed-cases-or-special-characters-in-it-on-android) 10. [Why doesn't `await authorize()` work on the web? How do I handle login?](#10-why-doesnt-await-authorize-work-on-the-web-how-do-i-handle-login) 11. [Why do my users get logged out frequently? How do I keep them logged in?](#11-why-do-my-users-get-logged-out-frequently-how-do-i-keep-them-logged-in) +12. [How can I prompt users to the login page versus signup page?](#12-how-can-i-prompt-users-to-the-login-page-versus-signup-page) ## 1. How can I have separate Auth0 domains for each environment on Android? @@ -337,3 +338,31 @@ const handleLogin = async () => { ``` By including this scope, the SDK will receive and securely store a `refreshToken`. This token will then be used by `getCredentials()` to maintain the user's session across app launches, providing a much smoother user experience. + +## 12. How can I prompt users to the login page versus signup page? + +If your application has one button for logging in and one button for signing up, you can prompt Auth0 to direct the user to the appropriate authentication page as such: + +```js +const login = async () => { + await authorize({ + scope: ..., + audience: ..., + additionalParameters: { + screen_hint: 'login' + } + }); + // continue with login process! +} + +const signup = async () => { + await authorize({ + scope: ..., + audience: ..., + additionalParameters: { + screen_hint: 'signup' + } + }); + // continue with signup process! +} +```