diff --git a/src/pages/api/auth/[...nextauth].ts b/src/pages/api/auth/[...nextauth].ts index 3df697ba4..a7161c70b 100644 --- a/src/pages/api/auth/[...nextauth].ts +++ b/src/pages/api/auth/[...nextauth].ts @@ -55,8 +55,6 @@ const findOrCreateUser = async ({ name: string; email: string; }) => { - // eslint-disable-next-line no-console - console.log('findOrCreateUser', provider, providerAccountId, name, email); return { id: '1', hasReadAgreement: false, @@ -118,7 +116,7 @@ export default NextAuth({ */ let newToken = token; if (account && user) { - // 查找或創建新用户(不更新已有用户) + // Info: (20240815-Tzuhan) 查找或創建新用户(不更新已有用户) const dbUser = await findOrCreateUser({ provider: account.provider, providerAccountId: account.providerAccountId, @@ -133,8 +131,6 @@ export default NextAuth({ hasReadAgreement: dbUser.hasReadAgreement, }; } - // eslint-disable-next-line no-console - console.log('jwt newToken', newToken); return newToken; }, async session({ session, token }) { diff --git a/src/pages/api/auth/error.ts b/src/pages/api/auth/error.ts index 9b2bba244..b69b908b5 100644 --- a/src/pages/api/auth/error.ts +++ b/src/pages/api/auth/error.ts @@ -3,10 +3,12 @@ import { NextApiRequest, NextApiResponse } from 'next'; export default async function handler(req: NextApiRequest, res: NextApiResponse) { try { const { error } = req.query; + // Deprecate: (20240820-Tzuhan) dev // eslint-disable-next-line no-console console.error('Authentication error:', error); return res.status(500).json({ message: `Authentication Error: ${error}` }); } catch (error) { + // Deprecate: (20240820-Tzuhan) dev // eslint-disable-next-line no-console console.error('Error in /api/auth/error:', error); return res.status(500).json({ message: 'Internal Server Error' }); diff --git a/src/pages/users/login-beta.tsx b/src/pages/users/login-beta.tsx index 68f204650..bebf8f3a5 100644 --- a/src/pages/users/login-beta.tsx +++ b/src/pages/users/login-beta.tsx @@ -82,6 +82,7 @@ export const getServerSideProps: GetServerSideProps = async ({ locale, query }) }, }; } catch (error) { + // Deprecate: (20240820-Tzuhan) dev // eslint-disable-next-line no-console console.error('Error in getServerSideProps:', error); diff --git a/src/types/next-auth.d.ts b/src/types/next-auth.d.ts index f1fec194c..f5053d7a1 100644 --- a/src/types/next-auth.d.ts +++ b/src/types/next-auth.d.ts @@ -1,3 +1,4 @@ +// Info: (20240815-Tzuhan) not used but can not remove for custom modification next-auth session type // eslint-disable-next-line @typescript-eslint/no-unused-vars import NextAuth from 'next-auth';