Skip to content

Bug #2

Description

@lewisnjue

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")

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions