-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed as not planned
Labels
Description
Describe the bug
Description
When accessing Memos through Cloudflare Tunnels, the application experiences authentication issues that don't occur when accessing directly via localhost or local DNS ingress.
Environment
- Setup: Local Kubernetes cluster.
- Memos Version: v0.24.0
- Browser: Orion, Brave, Chrome and Firefox
Observed Behavior
- The UI shows as if I'm logged in, but API calls are failing with authentication errors
- Refreshing the page logs me out immediately
- Access tokens do not appear in the Settings
- Storage configuration appears blank
- Notes and images don't appear immediately - must navigate to another section to make them appear
- Cannot make changes to notes after they appear
Expected Behavior
Authentication should work properly when accessing through Cloudflare Tunnels, just as it does when accessing directly.
Logs
2025/03/12 18:17:17 INFO client error method=/memos.api.v1.InboxService/ListInboxes error="rpc error: code = Unauthenticated desc = invalid access token"
2025/03/12 18:17:20 INFO OK method=/memos.api.v1.InboxService/ListInboxes
2025/03/12 18:21:00 INFO client error method=/memos.api.v1.UserService/GetUserSetting error="rpc error: code = Unauthenticated desc = invalid access token"
2025/03/12 18:21:01 INFO client error method=/memos.api.v1.UserService/ListUserAccessTokens error="rpc error: code = Unauthenticated desc = invalid access token"
2025/03/12 18:21:01 INFO client error method=/memos.api.v1.WorkspaceSettingService/GetWorkspaceSetting error="rpc error: code = PermissionDenied desc = permission denied"
2025/03/12 18:21:01 INFO OK method=/memos.api.v1.WorkspaceSettingService/GetWorkspaceSetting
2025/03/12 18:21:01 INFO client error method=/memos.api.v1.InboxService/ListInboxes error="rpc error: code = Unauthenticated desc = invalid access token"
2025/03/12 18:21:10 INFO client error method=/memos.api.v1.AuthService/GetAuthStatus error="rpc error: code = Unauthenticated desc = user not found"
Additional Context
- The configuration works perfectly with R2 Bucket when accessed via localhost or local DNS
- The app appears to be functioning on cache when accessed through Cloudflare Tunnels
- This behavior consistently occurs only when Cloudflare Tunnels is in the access chain
Steps to reproduce
Possible Cause
There might be issues with how authentication cookies or tokens are being handled when passing through Cloudflare Tunnels. It's possible headers are being modified or not properly forwarded.
I can provide additional information about my Kubernetes setup or steps to reproduce if needed.
The version of Memos you're using
v0.24.0
Screenshots or additional context
No response