-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(#71): correct full docker compose to use .env.docker
- Loading branch information
1 parent
cf12259
commit 77c6868
Showing
6 changed files
with
28 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
import { authOptions } from '@/lib/utils/auth-options'; | ||
import NextAuth from 'next-auth'; | ||
import { NextApiRequest, NextApiResponse } from 'next'; | ||
|
||
const handler = NextAuth(authOptions); | ||
const handler = (req: NextApiRequest, res: NextApiResponse) => { | ||
if (process.env.NEXTAUTH_ENABLE === 'false') { | ||
console.warn('NextAuth is disabled'); | ||
return res.status(200).json({ message: 'NextAuth is disabled' }); | ||
} | ||
return NextAuth(req, res, authOptions); | ||
}; | ||
export { handler as GET, handler as POST }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
import { NextResponse } from 'next/server'; | ||
export { default } from 'next-auth/middleware'; | ||
import type { NextRequest } from 'next/server'; | ||
|
||
export function middleware(request: NextRequest) { | ||
if (process.env.NEXTAUTH_ENABLE === 'false') { | ||
console.warn('NextAuth is disabled middleware'); | ||
return NextResponse.next(); | ||
} | ||
return NextResponse.redirect(new URL(request.url, request.url)); | ||
} | ||
|
||
export const config = { | ||
matcher: ['/:path*'], | ||
}; |