Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions backend/internal/api/v1/handlers/auth_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -740,5 +740,8 @@ func processGoogleIDToken(h *Handlers, w http.ResponseWriter, r *http.Request, g
url.QueryEscape(avatar),
url.QueryEscape(resp.AccessToken))

logger.Log.Info("Redirecting to auth-success.html with query params", zap.String("redirectURL", redirectURL))

// Ensure this redirect is not overwritten elsewhere
http.Redirect(w, r, redirectURL, http.StatusTemporaryRedirect)
}
12 changes: 12 additions & 0 deletions backend/nginx-container/nginx.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,18 @@ server {
proxy_redirect https://fluently_backend:8070/ https://$host/;
}

# Proxy /auth-success.html to backend for OAuth redirect with query params
location = /auth-success.html {
proxy_pass http://fluently_backend:8070/auth-success.html;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header Cookie $http_cookie;
}

# Catch-all for static files
location / {
try_files $uri $uri/ /index.html;
Expand Down
1 change: 1 addition & 0 deletions web-extension/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
(function() {
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
if (request.action === 'getAuthToken') {
// Parse URL parameters from the current page
const params = new URLSearchParams(window.location.search);
const token = params.get('access_token');
const email = params.get('email');
Expand Down