Skip to content

Commit

Permalink
chore: update deno_kv_oauth to 0.1.18-beta (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
iuioiua authored Jun 9, 2023
1 parent 266beb9 commit 7742868
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion import_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"stripe": "https://esm.sh/stripe@12.6.0",
"feed": "https://esm.sh/feed@4.2.2",
"fresh_charts/": "https://deno.land/x/fresh_charts@0.2.1/",
"deno_kv_oauth": "https://deno.land/x/deno_kv_oauth@v0.1.6-beta/mod.ts"
"deno_kv_oauth": "https://deno.land/x/deno_kv_oauth@v0.1.8-beta/mod.ts"
}
}
7 changes: 5 additions & 2 deletions routes/callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ async function getUser(accessToken: string): Promise<GitHubUser> {
// deno-lint-ignore no-explicit-any
export const handler: Handlers<any, State> = {
async GET(req) {
const { response, tokens, sessionId } = await handleCallback(req, client);
const { response, accessToken, sessionId } = await handleCallback(
req,
client,
);

const githubUser = await getUser(tokens.accessToken);
const githubUser = await getUser(accessToken);

const user = await getUserById(githubUser.id.toString());
if (!user) {
Expand Down

0 comments on commit 7742868

Please sign in to comment.