From f3ff38956b8e5066912f067157230db9d57d1ebb Mon Sep 17 00:00:00 2001 From: Michael Fatemi Date: Sat, 10 Apr 2021 15:17:00 -0400 Subject: [PATCH 1/2] Update endpoint, method --- src/api.ts | 2 +- src/components/Authenticator.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api.ts b/src/api.ts index 58a692b..79bd110 100644 --- a/src/api.ts +++ b/src/api.ts @@ -1,5 +1,5 @@ // eslint-disable-next-line const dev = process.env.NODE_ENV === 'development'; -export const API_ENDPOINT = 'http://localhost/api'; +export const API_ENDPOINT = 'http://localhost:5000/api'; export const ION_AUTHORIZATION_ENDPOINT = 'https://ion.tjhsst.edu/oauth/authorize?response_type=code&client_id=rNa6n9YSg8ftINdyVPpUsaMuxNbHLo9dh1OsOktR&scope=read&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fauth%2Fion%2Fcallback'; diff --git a/src/components/Authenticator.tsx b/src/components/Authenticator.tsx index db19a85..2055dae 100644 --- a/src/components/Authenticator.tsx +++ b/src/components/Authenticator.tsx @@ -12,7 +12,7 @@ export default function Authenticator() { useEffect(() => { fetch(`${API_ENDPOINT}/create_session`, { - method: 'post', + method: 'POST', body: JSON.stringify({ code, provider, From 801216c51cf63f90d841f89c093ed943ab09d3f0 Mon Sep 17 00:00:00 2001 From: Michael Fatemi Date: Sat, 10 Apr 2021 15:23:01 -0400 Subject: [PATCH 2/2] add content-type header to Authenticator --- src/components/Authenticator.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/Authenticator.tsx b/src/components/Authenticator.tsx index 2055dae..5a22f91 100644 --- a/src/components/Authenticator.tsx +++ b/src/components/Authenticator.tsx @@ -13,6 +13,9 @@ export default function Authenticator() { useEffect(() => { fetch(`${API_ENDPOINT}/create_session`, { method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, body: JSON.stringify({ code, provider,