Skip to content
This repository was archived by the owner on May 26, 2024. It is now read-only.

Commit a8b15ec

Browse files
committed
fix
fix fix
1 parent 00ac9f8 commit a8b15ec

File tree

4 files changed

+3
-35
lines changed

4 files changed

+3
-35
lines changed

.env

Lines changed: 0 additions & 22 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ next-env.d.ts
1717

1818
.next
1919
.vercel
20-
.env*.local
20+
.env*.local
21+
.env

pages/api/auth/[...nextauth].ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import NextAuth, { NextAuthOptions } from "next-auth"
22
import GithubProvider from "next-auth/providers/github"
3-
import { NextApiRequest, NextApiResponse } from "next"
43

54
// For more information on each option (and a full list of options) go to
65
// https://next-auth.js.org/configuration/options
@@ -13,11 +12,4 @@ export const authOptions: NextAuthOptions = {
1312
],
1413
}
1514

16-
export default (req: NextApiRequest, res: NextApiResponse) => {
17-
if (process.env.NEXTAUTH_URL) {
18-
// workaround: Since next-auth ignore NEXTAUTH_URL internally in favor of `x-forwarded-host` if deployed on Vercel,
19-
// we need to override the header here for NEXTAUTH_URL to take effect
20-
req.headers["x-forwarded-host"] = process.env.NEXTAUTH_URL
21-
}
22-
return NextAuth(req, res, authOptions)
23-
}
15+
export default NextAuth(authOptions)

pages/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import { useRouter } from "next/router";
21
import Layout from "../components/layout"
32

43
export default function IndexPage() {
5-
const router = useRouter();
6-
if (router.query.code && router.query.state) router.replace('/', undefined, { shallow: true });
74
return (
85
<Layout>
96
<h1>NextAuth.js Example</h1>

0 commit comments

Comments
 (0)