mirror of
https://github.com/AJaySi/ALwrity.git
synced 2026-04-25 00:45:54 +03:00
[PR #426] Harden user-data endpoints to use authenticated user IDs and remove single-user defaults #728
Labels
No labels
AI Content Agents
AI Content Strategy
AI Content planning
AI Marketing Tools
AI SEO
AI personalization
AI writer
ALwrity Copi-lot
Alwrity web search
Anthropic
DeepSeek
Gemini AI
Integration
LLM
OnBoarding
OnBoarding
RAG knowledgebase Memory
bug
documentation
enhancement
good first issue
help wanted
invalid
openai
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ALwrity#728
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/AJaySi/ALwrity/pull/426
Author: @AJaySi
Created: 3/12/2026
Status: 🔄 Open
Base:
main← Head:codex/update-user-data-endpoints-with-current-user-b20ga8📝 Commits (1)
8ba8c5eHarden user-data endpoints for authenticated user IDs📊 Changes
2 files changed (+42 additions, -15 deletions)
View changed files
📝
backend/api/user_data.py(+37 -10)📝
backend/services/user_data_service.py(+5 -5)📄 Description
Motivation
website_urlwhen website analysis (onboarding step 2) exists so clients get a consistent field.404instead of allowing unexpected 500s.Description
current_user: dict = Depends(get_current_user)to/,/website-url, and/onboardingendpoints and extractuser_id = str(current_user.get("id"))for all service calls.user_idexplicitly intoUserDataService.get_user_onboarding_data(user_id)andget_user_website_url(user_id).UserDataService.get_user_website_urlsignature to requireuser_id: strand removed the defaultuser_id=1assumption, and updated the integration call to use the explicit ID.HTTPException(status_code=404)when onboarding data is absent, re-raisesHTTPExceptioncleanly, ensuresdb_sessionis closed, and injects a top-levelwebsite_urlinto responses when awebsite_analysisexists.Testing
python -m py_compile backend/api/user_data.py backend/services/user_data_service.pywhich completed successfully.Codex Task
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.