From 32227f4d4ad100798064e73445f1c28e1da5bc79 Mon Sep 17 00:00:00 2001 From: Subhankar Maiti Date: Thu, 24 Jul 2025 12:50:10 +0530 Subject: [PATCH 1/2] docs(FAQ): add guidance for prompting users to login or signup --- FAQ.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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! +} +``` From 6651f2609b448e1f38559597dcdc3f93f6f7acb7 Mon Sep 17 00:00:00 2001 From: Subhankar Maiti Date: Thu, 24 Jul 2025 12:56:34 +0530 Subject: [PATCH 2/2] docs(EXAMPLES): update signup parameters to use additionalParameters object --- EXAMPLES.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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', // 👈🏻 + }, }); ```