Update main.py
Browse files
main.py
CHANGED
@@ -118,7 +118,7 @@ async def verify_email(verification_token: str, request: Request, db: Session =
|
|
118 |
return RedirectResponse("/protected")
|
119 |
|
120 |
# User authentication (protected route)
|
121 |
-
@app.
|
122 |
async def protected_route(request: Request, token: str = Depends(oauth2_scheme), db: Session = Depends(get_db)):
|
123 |
# Verify the access token
|
124 |
user = verify_token(token, my_secret_key, "HS256")
|
|
|
118 |
return RedirectResponse("/protected")
|
119 |
|
120 |
# User authentication (protected route)
|
121 |
+
@app.post("/protected", response_class=HTMLResponse) # Specify response_class as HTMLResponse
|
122 |
async def protected_route(request: Request, token: str = Depends(oauth2_scheme), db: Session = Depends(get_db)):
|
123 |
# Verify the access token
|
124 |
user = verify_token(token, my_secret_key, "HS256")
|