Merge branch 'DSAAS-18' into release(MVP)
This commit is contained in:
commit
c6d29b467c
1 changed files with 8 additions and 2 deletions
|
|
@ -15,14 +15,20 @@ class AuthenticateService:
|
|||
get_by_authenticate_action = GetByAuthenticateAction()
|
||||
|
||||
# Execução e retorno da action
|
||||
|
||||
get_by_authenticate_result = get_by_authenticate_action.execute(g_usuario_authenticate_schema)
|
||||
|
||||
# Se não encontrou o usuário, lança exceção ou retorna erro
|
||||
if get_by_authenticate_result is None:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
|
||||
detail='Usuário ou senha inválidos'
|
||||
)
|
||||
|
||||
# Verifica se a senha do usuário esta correta
|
||||
if not Security.is_hash(get_by_authenticate_result.senha_api):
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
|
||||
detail='A senha armazenada é inválida'
|
||||
detail='A senha informada é inválida'
|
||||
)
|
||||
|
||||
# Verifica se a senha do usuário esta correta
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue