update kontor-api to reflect api changes

This commit is contained in:
Thomas Peetz
2026-04-15 14:38:38 +02:00
parent 62e22c56c4
commit a68dd05794
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -5,7 +5,7 @@ from fastapi import APIRouter, Body, HTTPException, status, Depends, Response
from fastapi.security import OAuth2PasswordRequestForm
from src.core.config import settings
from src.core.security import create_access_token, authenticate_user_by_username, get_current_active_user
from src.core.security import create_access_token, authenticate_user_by_email, get_current_active_user
from src.db.models.admin import Profile
from src.schema.admin import Token, ProfileModel
from src.webapps.auth.forms import LoginForm
@@ -31,7 +31,7 @@ def login_for_access_token(form_data: Annotated[OAuth2PasswordRequestForm, Depen
# @router.post("/token-cookie", response_model=Token)
def login_for_token_cookie(response: Response, form_data: LoginForm = Depends()):
user = authenticate_user_by_username(form_data.username, form_data.password) # type: ignore
user = authenticate_user_by_email(form_data.username, form_data.password) # type: ignore
if not user:
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,