Skip to content

feat(auth): fix BFF cookie integration and enhance logging#55

Open
luisdlopera wants to merge 1 commit into
mainfrom
fix-auth-flow-audit-and-logging-7019139910850448693
Open

feat(auth): fix BFF cookie integration and enhance logging#55
luisdlopera wants to merge 1 commit into
mainfrom
fix-auth-flow-audit-and-logging-7019139910850448693

Conversation

@luisdlopera
Copy link
Copy Markdown
Owner

This PR addresses the authentication flow audit and fixing the core login issue.

Key changes:

  1. Auth Audit Report: Added auth-audit-report.md root file detailing the exact cause of the login failure (BFF and backend mismatch). Contains structural GitHub issues ready to be opened.
  2. Bug Fix: Fixed the Next.js 502 Invalid auth response by ensuring the backend always returns the refreshToken in the JSON payload, even if it is also setting a cookie via AUTH_COOKIES=true.
  3. Observability: Added extensive, granular debug logs with specific event names in the backend (login.use-case.ts) tracing the entire authentication verification process without exposing secrets.
  4. Resiliency: Added explicit error message logs to the Next.js BFF /api/auth/login handler to better document when payload constraints fail.

PR created automatically by Jules for task 7019139910850448693 started by @luisdlopera

- Generated comprehensive auth-audit-report.md detailing the login failure issue
- Fixed architecture inconsistency in NestJS backend where AUTH_COOKIES=true stripped refreshToken from JSON response, causing Next.js BFF to fail with 502
- Added granular debug logging events in the backend's login use case
- Enhanced Next.js BFF login route logging with error details when payload is incomplete
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant