Merge remote-tracking branch 'origin/DSAAS-18' into release(DSAAS)
This commit is contained in:
commit
98a2087136
1 changed files with 8 additions and 2 deletions
|
|
@ -15,14 +15,20 @@ class AuthenticateService:
|
||||||
get_by_authenticate_action = GetByAuthenticateAction()
|
get_by_authenticate_action = GetByAuthenticateAction()
|
||||||
|
|
||||||
# Execução e retorno da action
|
# Execução e retorno da action
|
||||||
|
|
||||||
get_by_authenticate_result = get_by_authenticate_action.execute(g_usuario_authenticate_schema)
|
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
|
# Verifica se a senha do usuário esta correta
|
||||||
if not Security.is_hash(get_by_authenticate_result.senha_api):
|
if not Security.is_hash(get_by_authenticate_result.senha_api):
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
|
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
|
# Verifica se a senha do usuário esta correta
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue