forked from open-webui/open-webui
refac
This commit is contained in:
parent
fb516ea694
commit
398b2076cd
1 changed files with 2 additions and 2 deletions
|
@ -1,6 +1,8 @@
|
||||||
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
|
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
|
||||||
from fastapi import HTTPException, status, Depends
|
from fastapi import HTTPException, status, Depends
|
||||||
|
|
||||||
from apps.web.models.users import Users
|
from apps.web.models.users import Users
|
||||||
|
from apps.web.models.auths import Auths
|
||||||
|
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
from typing import Union, Optional
|
from typing import Union, Optional
|
||||||
|
@ -97,8 +99,6 @@ def get_current_user(
|
||||||
|
|
||||||
|
|
||||||
def get_current_user_by_api_key(api_key: str):
|
def get_current_user_by_api_key(api_key: str):
|
||||||
from apps.web.models.auths import Auths
|
|
||||||
|
|
||||||
user = Auths.authenticate_user_by_api_key(api_key)
|
user = Auths.authenticate_user_by_api_key(api_key)
|
||||||
if user is None:
|
if user is None:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
|
|
Loading…
Reference in a new issue