fix: use authFetch for Todoist OAuth connect to send auth header
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 6s

This commit is contained in:
Play Life Bot
2026-01-02 15:40:06 +03:00
parent 72002a2b4f
commit 713f6020f6
2 changed files with 29 additions and 5 deletions

View File

@@ -5927,8 +5927,13 @@ func (a *App) todoistOAuthConnectHandler(w http.ResponseWriter, r *http.Request)
url.QueryEscape(redirectURI),
)
log.Printf("Todoist OAuth: redirecting user_id=%d to Todoist", userID)
http.Redirect(w, r, authURL, http.StatusTemporaryRedirect)
log.Printf("Todoist OAuth: returning auth URL for user_id=%d", userID)
// Возвращаем JSON с URL для редиректа (frontend сделает редирект)
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(map[string]interface{}{
"auth_url": authURL,
})
}
// todoistOAuthCallbackHandler обрабатывает OAuth callback