Skip to content

Commit e6e4b17

Browse files
Add screen_hint usage for login/signup in FAQ and fix usage in EXAMPLES.md (#1253)
1 parent 486de09 commit e6e4b17

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

EXAMPLES.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,10 @@ In the case of signup, you can add [an additional parameter](https://auth0.com/d
341341
auth0.webAuth.authorize({
342342
connection: realm,
343343
scope: scope,
344-
login_hint: email,
345-
screen_hint: 'signup', // 👈🏻
344+
additionalParameters: {
345+
login_hint: email,
346+
screen_hint: 'signup', // 👈🏻
347+
},
346348
});
347349
```
348350

FAQ.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
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)
1212
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)
1313
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)
14+
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)
1415

1516
## 1. How can I have separate Auth0 domains for each environment on Android?
1617

@@ -337,3 +338,31 @@ const handleLogin = async () => {
337338
```
338339

339340
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.
341+
342+
## 12. How can I prompt users to the login page versus signup page?
343+
344+
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:
345+
346+
```js
347+
const login = async () => {
348+
await authorize({
349+
scope: ...,
350+
audience: ...,
351+
additionalParameters: {
352+
screen_hint: 'login'
353+
}
354+
});
355+
// continue with login process!
356+
}
357+
358+
const signup = async () => {
359+
await authorize({
360+
scope: ...,
361+
audience: ...,
362+
additionalParameters: {
363+
screen_hint: 'signup'
364+
}
365+
});
366+
// continue with signup process!
367+
}
368+
```

0 commit comments

Comments
 (0)