Gregniuki commited on
Commit
3ec2cd6
1 Parent(s): ab95e7c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -288,11 +288,11 @@ async def register_post(
288
  try:
289
  registered_user = register_user(user_data, db)
290
  # Store user info in the session after successful registration
291
- request.session["user_info"] = {"username": registered_user.username, "email": registered_user.email}
292
  # Create an access token
293
  access_token = create_access_token(data={"sub": registered_user.email})
294
  # Redirect to the protected route
295
- response = RedirectResponse(url="/registration_successful")
296
  response.set_cookie(key="access_token", value=f"Bearer {access_token}", httponly=True)
297
  return response
298
  except HTTPException as e:
 
288
  try:
289
  registered_user = register_user(user_data, db)
290
  # Store user info in the session after successful registration
291
+ request.session["access_token"] = {"username": registered_user.username, "email": registered_user.email}
292
  # Create an access token
293
  access_token = create_access_token(data={"sub": registered_user.email})
294
  # Redirect to the protected route
295
+ response = RedirectResponse(url="/protected")
296
  response.set_cookie(key="access_token", value=f"Bearer {access_token}", httponly=True)
297
  return response
298
  except HTTPException as e: