Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardozgz committed Oct 20, 2024
1 parent 03ecc2a commit 0c7c94c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions apps/website/src/server/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ export function getOAuth2Url() {
export async function exchangeTokens(
exchangeMethod:
| {
code: string;
}
code: string;
}
| {
refreshToken: string;
},
refreshToken: string;
},
): Promise<Session> {
let body = {};
if ("code" in exchangeMethod) {
Expand Down Expand Up @@ -60,6 +60,10 @@ export async function exchangeTokens(
body: new URLSearchParams(body),
})
.then((res) => res.json())
.then(json => {
console.debug(body, json);
return json;
})
.then((res) => DiscordOAuth2TokenExchangeResponseSchema.parse(res));

if (tokenExchangeResponse.tokenType !== "Bearer")
Expand Down

0 comments on commit 0c7c94c

Please sign in to comment.