mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
added jwt testing framework
This commit is contained in:
parent
0529a81ac6
commit
eaa1fbf0ac
2 changed files with 2 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ class Settings(BaseSettings):
|
|||
API_KEY_NAME: str = "X-API-KEY"
|
||||
SECRET_KEY: str
|
||||
ALGORITHM: str
|
||||
ENVIRONMENT: str
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ def validate_jwt_token(token: str = Depends(oauth2_scheme)):
|
|||
|
||||
|
||||
async def validate_token(token: str = Depends(oauth2_scheme)):
|
||||
if get_settings().ENV != "local":
|
||||
if get_settings().ENVIRONMENT != "local":
|
||||
token_data = validate_jwt_token(token)
|
||||
if not token_data:
|
||||
raise HTTPException(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue