Skip to content

Comments

Bug: Fix page blinking after login#2640

Merged
hayescode merged 1 commit intoChainlit:mainfrom
ADWasHere:bug/blinking-auth-pages
Nov 25, 2025
Merged

Bug: Fix page blinking after login#2640
hayescode merged 1 commit intoChainlit:mainfrom
ADWasHere:bug/blinking-auth-pages

Conversation

@ADWasHere
Copy link
Contributor

When using the header_auth_callback and another auth callback for login, the page starts to "blink" as soon as a user logged in. This is because header_auth_callback always gets called when routing to the root.

Fix: Now when a user is already authenticated, the header_auth_callback won't be called
Issue: #2599

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. auth Pertaining to authentication. labels Nov 9, 2025
@ADWasHere ADWasHere changed the title Check if user is already authenticated Bug: Fix page blinking after login Nov 9, 2025
@constantinidan
Copy link
Collaborator

@cubic-dev-ai

@cubic-dev-ai
Copy link
Contributor

cubic-dev-ai bot commented Nov 12, 2025

@cubic-dev-ai

@constantinidan 👋 Hi! I'm cubic, Here's how I can help with your PR:

Ask questions

  • @cubic-dev-ai why did you suggest this change?

Request reviews

  • @cubic-dev-ai review this - Run a code review

Give feedback

  • @cubic-dev-ai this suggestion doesn't work for our use case

Request fixes

  • @cubic-dev-ai fix this - Generate a fix for the code. cubic will create a PR that merges into your branch.

@constantinidan
Copy link
Collaborator

@cubic-dev-ai review this

@cubic-dev-ai
Copy link
Contributor

cubic-dev-ai bot commented Nov 12, 2025

@cubic-dev-ai review this

@constantinidan I've started the AI code review. It'll take a few minutes to complete.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@hayescode hayescode added this pull request to the merge queue Nov 25, 2025
Merged via the queue into Chainlit:main with commit 9a9be68 Nov 25, 2025
10 checks passed
hayescode added a commit that referenced this pull request Dec 3, 2025
github-merge-queue bot pushed a commit that referenced this pull request Dec 4, 2025
fix issue introduced in #2640

Issue: The Cypress test should have an access_token cookie in
/auth/header response was failing in the "after reloading" test suite.
This happened because after a page reload, the user is already
authenticated via the cookie set during initial login, so the frontend
skips calling /auth/header again. The test was waiting for an
/auth/header request that never occurs in this scenario.

Fix: Moved the /auth/header cookie verification test out of the shared
shouldBeLoggedIn() function so it only runs during initial login. The
reload tests now only verify that the user remains logged in (no alert
message, "Hello admin" displayed) without expecting /auth/header to be
called again.

Also I updated the uv lock file. It has been a while.




<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Fixes the failing Cypress header-auth test in CI by asserting the
access_token cookie only on initial login. After reload, tests now
confirm the user is still logged in and no longer wait for /auth/header.

<sup>Written for commit d72e0ab.
Summary will update automatically on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auth Pertaining to authentication. size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants