Linted and formatted all files
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
from app.auth.cognito import initiate_auth
|
||||
from app.models.auth import SigninRequest, TokenResponse
|
||||
|
||||
router = APIRouter(
|
||||
prefix="/auth",
|
||||
tags=["authentication"]
|
||||
)
|
||||
router = APIRouter(prefix="/auth", tags=["authentication"])
|
||||
|
||||
|
||||
@router.post("/signin", response_model=TokenResponse, summary="Signin Endpoint")
|
||||
def signin(credentials: SigninRequest):
|
||||
"""
|
||||
Sign-in endpoint to authenticate the user with AWS Cognito using username and password.
|
||||
Sign-in endpoint to authenticate the user with AWS Cognito
|
||||
using username and password.
|
||||
On success, returns JWT tokens (access_token, id_token, refresh_token).
|
||||
"""
|
||||
auth_result = initiate_auth(credentials.username, credentials.password)
|
||||
@@ -19,4 +19,4 @@ def signin(credentials: SigninRequest):
|
||||
id_token=auth_result["IdToken"],
|
||||
refresh_token=auth_result.get("RefreshToken"),
|
||||
token_type="Bearer",
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user