Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset Password - fails #4

Open
gregoryfoster opened this issue Nov 27, 2022 · 2 comments
Open

Reset Password - fails #4

gregoryfoster opened this issue Nov 27, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@gregoryfoster
Copy link
Member

Settings -> User Settings -> Change your password
Entering the email address here (which shouldn't really be required since it's on the profile) and selecting "Reset Password" results in an error.

auth.js:26 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'value')
    at Object.resetPassword (auth.js:26:60)
    at HTMLButtonElement.onclick (VM1334 password-reset:112:163)
@keeganskeate
Copy link
Contributor

The main correction here was changing the login-email IDs to sign-in-email IDs in the reset password templates. A loading button and ID for the reset password button were also needed. Finally, a small script was added to populate the email input with the user's email if the user is already signed in.

<!-- JavaScript to get any signed-in user's email. -->
  <script>
    cannabisdata.firebase.onAuthChange(function(user) {
      if (user !== null) document.getElementById('sign-in-email').value = user.email;
    });
  </script>

@gregoryfoster
Copy link
Member Author

Hmm, no error in console now, but a JS popup message is shown:

Password Reset Error
Password reset email failed to send. Try again later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants