Skip to content

Commit

Permalink
chore: fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
usirin committed Aug 14, 2023
1 parent 66cf821 commit 9767c88
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions apps/gql/features/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ export const getSession = async (request: Request) => {
const headers = new Headers(request.headers);
try {
const cookie = headers.get("cookie");
const session = await fetch(`${env.NEXTAUTH_URL}/session`, {
const session = (await fetch(`${env.NEXTAUTH_URL}/session`, {
method: "GET",
headers: {
cookie: cookie || "",
},
}).then((res) => res.json());
return session satisfies Session;
}).then((res) => res.json())) as Session;

return session;
} catch (e) {
// handle error for session request fails
return null;
Expand Down

0 comments on commit 9767c88

Please sign in to comment.