blitz-js / legacy-framework

MIT License
3 stars 2 forks source link

/reset-password in the example doesn't work #310

Closed samrxth closed 3 years ago

samrxth commented 3 years ago

What is the problem?

Using the boilerplate code, Login, signup and mailing works but reseting passwords doesn't.

Paste all your error logs here:

N/A

Paste all relevant code snippets here:

All relevant code is boilerplate.

What are detailed steps to reproduce this?

  1. Clone this repository
  2. Install dependencies and run dev server
  3. go to /reset-password

Run blitz -v and paste the output here:

macOS Big Sur | darwin-arm64 | Node: v16.6.0

blitz: 0.39.0 (global)
blitz: 0.39.0 (local)

  Package manager: yarn
  System:
    OS: macOS 11.5.2
    CPU: (8) arm64 Apple M1
    Memory: 583.41 MB / 8.00 GB
    Shell: 3.3.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 16.6.0 - ~/.nvm/versions/node/v16.6.0/bin/node
    Yarn: 1.22.11 - ~/.nvm/versions/node/v16.6.0/bin/yarn
    npm: 7.19.1 - ~/.nvm/versions/node/v16.6.0/bin/npm
    Watchman: Not Found
  npmPackages:
    @prisma/client: 2.30.3 => 2.30.3
    blitz: 0.39.0 => 0.39.0
    prisma: 2.30.3 => 2.30.3
    react: alpha => 18.0.0-alpha-1314299c7-20210901
    react-dom: alpha => 18.0.0-alpha-1314299c7-20210901
    typescript: ~4.3 => 4.3.5

Please include below any other applicable logs and screenshots that show your problem:

No response

ananni13 commented 3 years ago

I'm not a blitz expert, but to my understanding the /reset-password page expects a token as a query parameter, it obviously won't work without it.

You first need to go to /forgot-password and submit the form with your account email, this will generate and save a RESET_PASSWORD token for that account (see forgotPassword.ts mutation). Then you'll receive an email (in dev you'll just get the preview to open in the browser, see forgotPasswordMailer.ts) with the correct /reset-password link and with the token as a query param, if you click on that the reset should work.

samrxth commented 3 years ago

Thanks, works now