From dbf2d45c2c70fd95dc097f4bbbc5addd9d95a87b Mon Sep 17 00:00:00 2001 From: slaventius Date: Tue, 28 Feb 2023 16:10:04 +0300 Subject: [PATCH] * --- internal/auth.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/auth.go b/internal/auth.go index 8fefeb1..49b53fc 100644 --- a/internal/auth.go +++ b/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))) } }