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?
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
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: