Skip to content

Commit

Permalink
oauth callback returns json object not string
Browse files Browse the repository at this point in the history
  • Loading branch information
sverhoeven committed Jun 30, 2023
1 parent cf89c82 commit 58a021e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/models/user.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export async function oauthCallback(provider: string, search: URLSearchParams) {
state: search.get("state") || undefined,
error: search.get("error") || undefined,
};
let response: string;
let response: any;
switch (provider) {
case "github":
response = await api.oauthGithubRemoteCallback(request);
Expand All @@ -86,8 +86,7 @@ export async function oauthCallback(provider: string, search: URLSearchParams) {
default:
throw new Error("Unknown provider");
}
const body = JSON.parse(response);
return body.access_token;
return response.access_token;
}

export async function getLevel(
Expand Down

0 comments on commit 58a021e

Please sign in to comment.