Good day! I’m trying to implement a Passwordless login using auth0 node package. Basically I’m trying to send magic link through email without getting the email value in the browser, so I’m getting the email from an API.
Note: The email that has been pulled from other API is already registered in Auth0
The problem was when I receive the link in my Inbox and click it, I’m getting the Opt-in that I should allow the app to access the profile, which is not the path that I’m expected to see. So here’s my code:
const AuthenticationClient = require('auth0').AuthenticationClient
app.get('/sendmagiclink', function(req, res) {
let auth0 = new AuthenticationClient({
domain: [Auth0 Domain],
clientId: [Auth0 Client ID],
clientSecret: [Auth0 Client Secret]
})
var data = {
email: 'myemail@gmail.com',
send: 'link',
authParams: {
connection: [My Connection]
} // Optional auth params.
};
auth0.passwordless.sendEmail(data, function (err) {
if (err) {
// Handle error.
}
});
})
Also, another problem with my code is the connection name which automatically sets to email rather than the custom connection name I created.
Your thoughts would be greatly appreciated.