full-stack-fastapi-mongodb icon indicating copy to clipboard operation
full-stack-fastapi-mongodb copied to clipboard

Validation email and Magic Link errors in generated app

Open scattered-development opened this issue 1 year ago • 3 comments
trafficstars

details below - I am assuming that these are intended to work out the box, is that correct?

Two similar issues that might be better separate but documenting as one for now in case the root is the same

I can look to fix during the week any pointers appreciated.

Validation Email

validation doesn't work, get error in browser and a 404 for the request in the backend logs

I tried logging in as two other users (one admin one normal) and noted that the email in the is always the same and that of the first super user.

image

Validation error
Please check your email and try again.
172.21.0.7:33442 - "POST /api/v1/login/oauth HTTP/1.1" 200
2024-07-21 19:27:54 INFO       172.21.0.7:33442 - "OPTIONS /api/v1/users/ HTTP/1.1" 200
2024-07-21 19:27:54 INFO       172.21.0.7:33442 - "GET /api/v1/users/ HTTP/1.1" 200
2024-07-21 19:28:02 INFO       172.21.0.7:38152 - "OPTIONS /api/v1/users/send-validation-email HTTP/1.1" 200
2024-07-21 19:28:02 INFO       172.21.0.7:38152 - "POST /api/v1/users/send-validation-email HTTP/1.1" 404

MAGIC LINK

It seems that the tokens are not present client side

The magic link email is sent but pasting into browser returns a bad request due to missing port adding port :3000 takes me to page magic page where I get a front end error and a 403 in the backend

EDIT - I forgot I have edited the email client and need to check that as the cause

Login error
Ensure you're using the same browser and that the token hasn't expired

"POST /api/v1/login/claim HTTP/1.1" 403

scattered-development avatar Jul 21 '24 17:07 scattered-development

Fixed

Turns out the error is due to the payload types; the keys are of type string but the Model expects ObjectId. Fixing this sorts out the validation link as well. Again, can create a PR if wanted.

incorrect email in form on screen but guessing this is just incomplete nature of a template - if you want that updating as well let me know

scattered-development avatar Jul 24 '24 17:07 scattered-development

Hi @scattered-development, yes, please create a PR!

blink1073 avatar Jul 26 '24 18:07 blink1073

PR here sorry for delay https://github.com/mongodb-labs/full-stack-fastapi-mongodb/pull/53

scattered-development avatar Aug 20 '24 17:08 scattered-development

PR Merged!

Jibola avatar Sep 06 '24 18:09 Jibola