feat(users): add user administration and password management
This commit is contained in:
parent
47f54d3461
commit
b584e60273
16 changed files with 720 additions and 22 deletions
|
|
@ -1,5 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from datetime import UTC, datetime
|
||||
|
||||
from fastapi import HTTPException, status
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
|
|
@ -19,5 +21,6 @@ class AuthService:
|
|||
detail="Invalid credentials",
|
||||
headers={"WWW-Authenticate": "Bearer"},
|
||||
)
|
||||
return create_access_token(user.id, user.role.value)
|
||||
|
||||
user.last_login_at = datetime.now(UTC)
|
||||
self.users.session.commit()
|
||||
return create_access_token(user.id, user.role)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue