Skip to content

Commit 681ab74

Browse files
zachlagdenclaude
andcommitted
fix(auth): resolve 401 errors caused by cookie loss during 307 redirects
Add proxy-headers and forwarded-allow-ips to uvicorn so it reads X-Forwarded-Proto from Traefik and uses the correct https scheme in redirect URLs. Fix JS API calls to use trailing-slash URLs, avoiding the 307 redirect that was dropping the Secure session cookie. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 6534a32 commit 681ab74

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ EXPOSE 8080
3939
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
4040
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8080/health')" || exit 1
4141

42-
CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"]
42+
CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080", "--proxy-headers", "--forwarded-allow-ips", "*"]

src/static/js/app_dashboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ async function fetchDashboardData() {
2525
try {
2626
// Fetch user data
2727
const userResponse = await $.ajax({
28-
url: '/api/me',
28+
url: '/api/me/',
2929
method: 'GET',
3030
dataType: 'json',
3131
});

src/static/js/app_settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ let userData = null;
55
async function fetchUserData() {
66
try {
77
const response = await $.ajax({
8-
url: '/api/me',
8+
url: '/api/me/',
99
method: 'GET',
1010
dataType: 'json',
1111
});

0 commit comments

Comments
 (0)