This repository was archived by the owner on May 26, 2024. It is now read-only.
File tree 4 files changed +3
-35
lines changed 4 files changed +3
-35
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -17,4 +17,5 @@ next-env.d.ts
17
17
18
18
.next
19
19
.vercel
20
- .env * .local
20
+ .env * .local
21
+ .env
Original file line number Diff line number Diff line change 1
1
import NextAuth , { NextAuthOptions } from "next-auth"
2
2
import GithubProvider from "next-auth/providers/github"
3
- import { NextApiRequest , NextApiResponse } from "next"
4
3
5
4
// For more information on each option (and a full list of options) go to
6
5
// https://next-auth.js.org/configuration/options
@@ -13,11 +12,4 @@ export const authOptions: NextAuthOptions = {
13
12
] ,
14
13
}
15
14
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 )
Original file line number Diff line number Diff line change 1
- import { useRouter } from "next/router" ;
2
1
import Layout from "../components/layout"
3
2
4
3
export default function IndexPage ( ) {
5
- const router = useRouter ( ) ;
6
- if ( router . query . code && router . query . state ) router . replace ( '/' , undefined , { shallow : true } ) ;
7
4
return (
8
5
< Layout >
9
6
< h1 > NextAuth.js Example</ h1 >
You can’t perform that action at this time.
0 commit comments