Hi
I have a hosted login page where I allow the user to login/signup with social login or passwordless (email).
I open the login page from AngularJS like this:
angularAuth0.authorize({
allowed_connections: ['linkedin', 'facebook', 'google-oauth2', 'windowslive', 'email'],
language: lang,
nonce: getNonce(),
login_hint: "test@example.com"
});
and at the hosted page, I do this:
var config = JSON.parse(decodeURIComponent(escape(window.atob('@@config@@'))));
config.extraParams = config.extraParams || {};
var allowed_connections = config.extraParams.allowed_connections;
var language = config.extraParams.language;
var loginHint = config.extraParams.login_hint;
var prompt = config.prompt;
var lock = new Auth0LockPasswordless(config.clientID, config.auth0Domain, {
auth: {
redirectUrl: config.callbackURL,
responseType: (config.internalOptions || {}).response_type ||
(config.callbackOnLocationHash ? 'token' : 'code'),
params: config.internalOptions
},
assetsUrl: config.assetsUrl,
allowedConnections: allowed_connections ? allowed_connections : null,
rememberLastLogin: !prompt,
language: language,
languageDictionary: i18n[language],
prefill: loginHint ? { email: loginHint, username: loginHint } : null,
theme: {
primaryColor: '#4C66AC',
labeledSubmitButton: false
},
closable: false,
// we want small buttons for social providers
socialButtonStyle: 'small'
});
lock.show();
But the email doesn’t get prefilled! . Is there a mistake in my code, or can the passwordless email field not be prefilled?
1 Like
Update
I have installed “Real-time Webtask Logs” and can see the login_hint is part of the context object… I’t just doesn’t get used in the email field
{
"request": {
"query": {
"protocol": "oauth2",
"client_id": "...",
"response_type": "token id_token",
"redirect_uri": "https://.../auth0/callback",
"scope": "openid email profile user_metadata app_metadata",
"audience": "https://....eu.auth0.com/userinfo",
"allowed_connections": [Object],
"language": "da",
"nonce": "...",
"login_hint": "test@example.com",
"state": "...",
"auth0Client": "...",
"verification_code": "632603",
"_intstate": "deprecated",
"_csrf": "...",
"connection": "email",
"email": "...",
"popup": false
}
}
}
No. I’m still waiting for a response from someone who knows if/how this is possible.
ajv
October 25, 2018, 7:21am
5
The prefill
option takes in an object (defining the username
and/or email
) - you’re passing in a string. Maybe that’s the culprit?
https://auth0.com/docs/libraries/lock/v11/configuration#prefill-object-
Edit: Seems that the prefill
support for Passwordless was added less than a day ago:
# Change Log
## [v12.0.0](https://github.com/auth0/lock/tree/v12.0.0) (2023-01-20)
[Full Changelog](https://github.com/auth0/lock/compare/v11.35.0...v12.0.0)
Lock is now built using React 18, which resolves a number of security vulnerabilities and improves performance. If you encounter any issues relating to this upgrade, please [submit a bug report](https://github.com/auth0/lock/issues/new?assignees=&labels=bug+report,v12&template=report_a_bug.md&title=).
Despite the major version bump, **v12 is completely API-compatible with v11**.
**Changed**
- Upgrade to React 18 [\#2209](https://github.com/auth0/lock/pull/2209) ([stevehobbsdev](https://github.com/stevehobbsdev))
- Upgrade to Webpack 5 [\#2213](https://github.com/auth0/lock/pull/2213) ([stevehobbsdev](https://github.com/stevehobbsdev))
- Various dependency bumps [see the full changelog](https://github.com/auth0/lock/compare/v11.35.0...v12.0.0)
## [v11.35.0](https://github.com/auth0/lock/tree/v11.35.0) (2022-12-19)
[Full Changelog](https://github.com/auth0/lock/compare/v11.34.2...v11.35.0)
This file has been truncated. show original
opened 10:12AM - 13 Apr 18 UTC
closed 01:48PM - 13 Apr 18 UTC
is it possible to prefill the email adress when using
`this.lock.emailcode(opti… ons, this._doAuthentication.bind(this));`
By adding `options.prefill = {email: 'someone@example.com'}` it does not work.
system
Closed
August 27, 2019, 1:56pm
7
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.