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:
parent
c566541538
commit
614d7c915d
packages
@ -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 } }
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user