firebase-js-sdk icon indicating copy to clipboard operation
firebase-js-sdk copied to clipboard

sendSignInLinkToEmail not checking if user is valid

Open david-potgieter opened this issue 7 years ago • 2 comments

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

  1. Pass an email address to the function below, that does not have a registered user in the backend
  2. Send auth link
  3. 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)
    })

david-potgieter avatar Mar 29 '19 09:03 david-potgieter

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Mar 29 '19 09:03 google-oss-bot

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

david-potgieter avatar Mar 29 '19 09:03 david-potgieter