implement deactivation & add route

This commit is contained in:
kiwiidb
2023-05-24 12:31:50 +02:00
parent 6e9eb5d467
commit 4f006717fa
3 changed files with 11 additions and 1 deletions

View File

@@ -68,6 +68,9 @@ func (controller *AuthController) Auth(c echo.Context) error {
accessToken, refreshToken, err := controller.svc.GenerateToken(c.Request().Context(), body.Login, body.Password, body.RefreshToken)
if err != nil {
if err.Error() == responses.AccountDeactivatedError.Message {
return c.JSON(http.StatusUnauthorized, responses.AccountDeactivatedError)
}
return c.JSON(http.StatusUnauthorized, responses.BadAuthError)
}