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