File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
{{cookiecutter.project_slug}}/backend/app/app/api/api_v1/endpoints Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 11from typing import Any , Union
22
3+ from bson import ObjectId
4+
35from fastapi import APIRouter , Body , Depends , HTTPException
46from fastapi .security import OAuth2PasswordRequestForm
57from motor .core import AgnosticDatabase
1517
1618router = APIRouter ()
1719
20+
21+
1822"""
1923https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Authentication_Cheat_Sheet.md
2024Specifies minimum criteria:
@@ -64,7 +68,7 @@ async def validate_magic_link(
6468 """
6569 claim_in = deps .get_magic_token (token = obj_in .claim )
6670 # Get the user
67- user = await crud .user .get (db , id = magic_in .sub )
71+ user = await crud .user .get (db , id = ObjectId ( magic_in .sub ) )
6872 # Test the claims
6973 if (
7074 (claim_in .sub == magic_in .sub )
@@ -241,7 +245,7 @@ async def reset_password(
241245 """
242246 claim_in = deps .get_magic_token (token = claim )
243247 # Get the user
244- user = await crud .user .get (db , id = magic_in .sub )
248+ user = await crud .user .get (db , id = ObjectId ( magic_in .sub ) )
245249 # Test the claims
246250 if (
247251 (claim_in .sub == magic_in .sub )
You can’t perform that action at this time.
0 commit comments