Closed matthieuh closed 3 years ago
I actually had the same question last night. Going to noodle about how to add this!
As of 1.0.6 you can POST any payload you want!
fetch(`/auth/magiclogin`, {
method: `POST`,
body: JSON.stringify({
// `destination` is required.
destination: email,
// You can POST anything else in your payload...
name: name,
}),
headers: { 'Content-Type': 'application/json' }
})
And then you can access it in verify
! :tada:
const magicLogin = new MagicLoginStrategy({
// "payload" contains "destination" and anything else you POST'ed
verify: (payload, callback) => {
console.log(payload.name)
}
})
That's awesome thank you 🙏
First of all, thank you this package is awesome 😍
I would have one question though: Is it possible to pass more data at signup than just the email address (like a username, language, etc.) or is it an anti-pattern with this way of authenticated a user?