modified: serv_nginx/api_bb/internal/handlers/auth.go

modified:   serv_nginx/api_bb/internal/service/auth_service.go
add update user path to put:profile
This commit is contained in:
2025-10-11 05:11:21 +05:00
parent 20d4913f50
commit 7eaddd9f37
2 changed files with 42 additions and 22 deletions
+2 -1
View File
@@ -42,13 +42,14 @@ func (h *AuthHandler) Routes() chi.Router {
r.Post("/login", h.Login)
r.Post("/logout", h.Logout)
r.Get("/profile", h.GetProfile)
r.Put("/profile", h.UpdateProfile)
return r
}
// Обработчик для OPTIONS запросов
func (h *AuthHandler) handleOptions(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS")
w.Header().Set("Access-Control-Allow-Methods", "POST, PUT, GET, OPTIONS")
w.Header().Set("Access-Control-Allow-Headers", "Content-Type, Authorization")
w.Header().Set("Access-Control-Max-Age", "300")
w.WriteHeader(http.StatusOK)