2
0
mirror of https://github.com/lowdefy/lowdefy.git synced 2025-03-19 15:01:06 +08:00

fix: Fix userFields in production server.

This commit is contained in:
Sam 2022-06-23 16:05:21 +02:00
parent c566541538
commit 614d7c915d
No known key found for this signature in database
GPG Key ID: D004126FCD1A6DF0
2 changed files with 20 additions and 4 deletions
packages
server-dev/pages/api/auth
server/pages/api/auth

@ -23,6 +23,19 @@ import events from '../../../build/plugins/auth/events.js';
import providers from '../../../build/plugins/auth/providers.js';
// TODO: make createApiContext synchronous
export default NextAuth(
getNextAuthConfig({ logger: console }, { authJson, plugins: { callbacks, events, providers } })
);
export default async function auth(req, res) {
if (authJson.configured === true) {
return await NextAuth(
req,
res,
getNextAuthConfig(
{ logger: console },
{ authJson, plugins: { callbacks, events, providers } }
)
);
}
return res.status(404).json({
message: 'Auth not configured',
});
}

@ -27,7 +27,10 @@ export default async function auth(req, res) {
return await NextAuth(
req,
res,
getNextAuthConfig({ authJson, plugins: { callbacks, events, providers } })
getNextAuthConfig(
{ logger: console },
{ authJson, plugins: { callbacks, events, providers } }
)
);
}