slaventius 2 years ago
parent 58ab2f4d86
commit dbf2d45c2c
  1. 6
      internal/auth.go

@ -173,11 +173,13 @@ func login(s *AuthServer) http.HandlerFunc {
s.logger.Error(status.Message())
//
w.WriteHeader(http.StatusUnauthorized)
w.Write([]byte(status.Message()))
return
}
w.WriteHeader(http.StatusOK)
w.Write([]byte(fmt.Sprintf("Success login for %s", uid)))
}
}
@ -195,6 +197,7 @@ func registration(s *AuthServer) http.HandlerFunc {
s.logger.Error(status.Message())
//
w.WriteHeader(http.StatusUnauthorized)
w.Write([]byte(status.Message()))
return
@ -204,6 +207,7 @@ func registration(s *AuthServer) http.HandlerFunc {
s.prometheus.IncUsersRegistered()
//
w.WriteHeader(http.StatusOK)
w.Write([]byte(fmt.Sprintf("Success registration for %s", uid)))
}
}
@ -219,6 +223,7 @@ func confirmation(s *AuthServer) http.HandlerFunc {
s.logger.Error(status.Message())
//
w.WriteHeader(http.StatusUnauthorized)
w.Write([]byte(status.Message()))
return
@ -228,6 +233,7 @@ func confirmation(s *AuthServer) http.HandlerFunc {
s.prometheus.IncUsersConfirmed()
//
w.WriteHeader(http.StatusOK)
w.Write([]byte(fmt.Sprintf("Success confirmation for %s", code)))
}
}

Loading…
Cancel
Save