feat: authed users in env
This commit is contained in:
parent
5f069285c2
commit
3a1e822b63
3 changed files with 5 additions and 1 deletions
|
|
@ -52,7 +52,7 @@ claims_dependency = Annotated[dict[str, Any], Depends(get_current_user)]
|
|||
|
||||
|
||||
async def is_authed_user(claims: claims_dependency) -> bool:
|
||||
authed_users: list[str] = ["chris@sr2.uk"]
|
||||
authed_users: list[str] = auth_settings.AUTHORISED_USERS
|
||||
user_email = claims.get("email", None)
|
||||
if not user_email or user_email not in authed_users:
|
||||
raise HTTPException(status_code=403, detail="Not authenticated")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue