firebase-js-sdk
firebase-js-sdk copied to clipboard
sendSignInLinkToEmail not checking if user is valid
[REQUIRED] Describe your environment
- Operating System version: macOS 10.14.3
- Browser version: Chrome Version 72.0.3626.119
- Firebase SDK version: 5.5.7
- Firebase Product:
auth
[REQUIRED] Describe the problem
Steps to reproduce:
Follow getting started steps on password-less auth:
- Pass an email address to the function below, that does not have a registered user in the backend
- Send auth link
- Receive login link, even though user is not registered or known
Relevant Code:
const actionCodeSettings = {
url: 'whitelisted_domain/link-request',
handleCodeInApp: true,
}
firebase
.auth()
.sendSignInLinkToEmail('[email protected]', actionCodeSettings)
.then(() => {
console.log('sent')
window.localStorage.setItem('emailForSignIn', '[email protected]')
})
.catch(error => {
console.log(error)
})
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Ah, seems like we need to link the two methods - and at that point we can validate known users: https://firebase.google.com/docs/auth/web/email-link-auth#linkingre-authentication_with_email_link