I don’t get idToken value, when I try to login with email (login provider: email_passwordless). This way only works for my main email, but when I try to login using another one, I don’t get idToken value.
My code:
const login = async (
loginProvider: string,
data: { login_hint?: string; referralCode: string | null }
) => {
if (!web3auth) {
return;
}
try {
await web3auth.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
loginProvider,
login_hint: data.login_hint
});
authData.onSetIsLoading(true);
const user = await web3auth.getUserInfo();
...
} catch (err: any) {
…
}
};
vjgee
August 24, 2023, 4:19pm
2
@lfgprojectmail Welcome Aboard!
Can you share the response you receive ? You need to specify the loginProvider as Passwordless:
import { WALLET_ADAPTERS } from "@web3auth/base";
const web3authProvider = await web3auth.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
loginProvider: "email_passwordless",
extraLoginOptions: {
login_hint: "hello@web3auth.io", // email to send the OTP to
},
});
You will have to pass login_hint
as user’s email and domain
as your app domain in extraLoginOptions
while using email_passwordless
loginProvider
You can refer to the below documentation on the usage:
loginProvider is specified as “email_passwordless”. I tried to move login_hint to extraLoginOptions, but it’s still not working for my other emails.
I have two google emails . When I try to login with my first email I get this response data:
{
aggregateVerifier: "tkey-auth0-email-passwordless"
dappShare: ""
email: "firstemail@gmail.com"
**idToken: "eyJhbGciOiJFUzI1NiIsInR5cCI6Ik..."**
name: "firstemail@gmail.com"
oAuthAccessToken: ""
oAuthIdToken: ""
profileImage: ""
typeOfLogin: "jwt"
verifier: "torus"
verifierId: "firstemail@gmail.com"
}
As you can see field idToken has value, but when I try to login with my second email I get the response data with empty idToken :
{
aggregateVerifier: "tkey-auth0-email-passwordless"
dappShare: ""
email: "secondemail@gmail.com"
**idToken: ""**
name: "secondemail@gmail.com"
oAuthAccessToken: ""
oAuthIdToken: ""
profileImage: ""
typeOfLogin: "jwt"
verifier: "torus"
verifierId: "secondemail@gmail.com"
}
That’s weird. If I use loginProvider as “google” (modal sdk) it works for all my emails.
Does it depend on the google account setting in any way?
vjgee
August 25, 2023, 12:45pm
4
I have forwarded your issue to our team and will get back once more information becomes available.
Ok, thank you. I look forward to hearing from you.
vjgee
August 28, 2023, 5:31pm
6
@lfgprojectmail Are you setting up Email passwordless with Auth0?
vjgee
September 2, 2023, 10:36pm
7
Have you upgraded to the latest Web No-Modal SDK version 6.1.7 ?