File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99
1010from auth_backend .auth_method .base import AuthPluginMeta
1111from auth_backend .base import Base
12- from auth_backend .models .db import AuthMethod , UserSession
12+ from auth_backend .models .db import AuthMethod , User , UserSession
1313from auth_backend .utils .security import UnionAuth
1414
1515
@@ -205,8 +205,7 @@ async def _unlink(
205205 """
206206 if cls .delete_scope () not in (s .name for s in request_user .scopes ):
207207 raise HTTPException (status_code = HTTP_403_FORBIDDEN , detail = "Not authorized" )
208- username = await cls . __get_username (user_id )
209- if not username :
208+ user = User . get (user_id , session = db . session )
209+ if not user :
210210 raise UserNotLinked (user_id )
211- username .is_deleted = True
212- db .session .commit ()
211+ await cls ._delete_auth_methods (user , db_session = db .session )
Original file line number Diff line number Diff line change 77
88from annotated_types import Gt
99from pydantic import PostgresDsn
10- from pydantic .types import PathType
1110from pydantic_settings import BaseSettings , SettingsConfigDict
1211
1312
You can’t perform that action at this time.
0 commit comments