Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: service to use default credentials mode when cookie auth disabled #5079

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

blackjid
Copy link

@blackjid blackjid commented Feb 6, 2025

Thanks for submitting a PR! Please check the boxes below:

  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

There was a problem when the cookie authentication is disabled and we expect some cookies to be send on the requests. This was an issue when using Cloudflare Access, where the authentication sets the CF_Authentication cookie that is needed. The refactor add credentials: omit to the fetch method, which cause all requests to fail before reaching the flagsmith api.

The change of behaviour was introduced here

To fix it the service that call api endpoints from the frontend now uses the default value for credentials when the cookie authentication is disabled. This is the same behaviour it used to have before the cookie authentication refactor.

How did you test this code?

I test it manually using the content override feature of the chrome developer tools.

@blackjid blackjid requested a review from a team as a code owner February 6, 2025 13:58
@blackjid blackjid requested review from tiagoapolo and removed request for a team February 6, 2025 13:58
@github-actions github-actions bot added the front-end Issue related to the React Front End Dashboard label Feb 6, 2025
Copy link

vercel bot commented Feb 6, 2025

@blackjid is attempting to deploy a commit to the Flagsmith Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented Feb 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 10, 2025 5:30pm
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 10, 2025 5:30pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Feb 10, 2025 5:30pm

Copy link
Contributor

github-actions bot commented Feb 6, 2025

Uffizzi Ephemeral Environment deployment-60686

☁️ https://app.uffizzi.com/github.com/Flagsmith/flagsmith/pull/5079

📄 View Application Logs etc.

What is Uffizzi? Learn more!

@matthewelwell
Copy link
Contributor

Thanks @blackjid , one of the team will take a look at this and get back to you soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
front-end Issue related to the React Front End Dashboard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants