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

Bug #2

Open
lewisnjue opened this issue Nov 10, 2024 · 0 comments
Open

Bug #2

lewisnjue opened this issue Nov 10, 2024 · 0 comments

Comments

@lewisnjue
Copy link

lewisnjue commented Nov 10, 2024

In main.py under signup post view , you are not creating a user. After checking if the email and password are okay you are just returning redirect

you should :

@app.post("/signup", response_class=HTMLResponse)
def signup_post_view(request: Request, 
   email: str=Form(...), 
   password: str = Form(...),
   password_confirm: str = Form(...)
   ):
   raw_data  = {
       "email": email,
       "password": password,
       "password_confirm": password_confirm
   }
   data, errors = utils.valid_schema_data_or_error(raw_data, UserSignupSchema)
   if len(errors) > 0:
       return render(request, "auth/signup.html", {"errors":errors}, status_code=400)
   else:
       User.create_user(email = raw_data['email'],password=raw_data['password'])


   return redirect("/login")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant