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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user