Skip to content
This repository has been archived by the owner on Apr 10, 2023. It is now read-only.

fix(fetch): pass credentials: include #6

Merged
merged 8 commits into from
Jan 17, 2023
Merged

fix(fetch): pass credentials: include #6

merged 8 commits into from
Jan 17, 2023

Conversation

GeorgeMac
Copy link
Member

This is perhaps a little premature. However, I have auth running locally and bumped into a bit.
Ultimately, we're going to want this enabled on requests. For Cookies to be sent.

I also updated the fetcher a little to include more details. Stolen from the SWR docs themselves:
https://swr.vercel.app/docs/error-handling#status-code-and-error-object

@@ -234,6 +234,6 @@ export async function evaluate(flagKey: string, values: any) {
//
// meta
export async function getInfo() {
const res = await fetch(`${metaURL}/info`);
const res = await fetch(metaURL + '/info', { credentials: 'include' });
Copy link
Contributor

Choose a reason for hiding this comment

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

@GeorgeMac I'm guessing we'll need to add this to all our API calls?

@markphelps markphelps merged commit 8884d15 into main Jan 17, 2023
@markphelps markphelps deleted the gm/authorize branch January 17, 2023 17:11
markphelps added a commit that referenced this pull request Jan 18, 2023
* main:
  fix(fetch): pass credentials: include (#6)
  chore: rename error hook; cleanup (#31)
  chore(deps-dev): bump prettier from 2.8.2 to 2.8.3 (#29)
  chore(deps-dev): bump @typescript-eslint/eslint-plugin (#34)
  chore(deps-dev): bump @typescript-eslint/parser from 5.48.1 to 5.48.2 (#35)
  chore(deps-dev): bump eslint from 8.31.0 to 8.32.0 (#30)
  chore(deps-dev): bump eslint-plugin-react from 7.32.0 to 7.32.1 (#33)
  chore(deps-dev): bump eslint-plugin-import from 2.27.4 to 2.27.5 (#32)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants