mirror of
https://github.com/gethomepage/homepage.git
synced 2026-09-27 22:41:16 -07:00
Fix: prevent 500s when auth not enabled
This commit is contained in:
@@ -150,4 +150,16 @@ export const authOptions = {
|
||||
},
|
||||
};
|
||||
|
||||
export default NextAuth(authOptions);
|
||||
const nextAuthHandler = NextAuth(authOptions);
|
||||
|
||||
export default async function handler(req, res) {
|
||||
// Just pass empty session if auth not enabled
|
||||
if (!authEnabled) {
|
||||
if (req.query.nextauth?.[0] === "session") {
|
||||
return res.status(200).json({});
|
||||
}
|
||||
return res.status(404).end("Not Found");
|
||||
}
|
||||
|
||||
return nextAuthHandler(req, res);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user