feat: add more logging for error debugging

This commit is contained in:
lucas-neynar
2025-04-10 10:56:48 -07:00
parent b3e419b1f6
commit 6c35293e80
2 changed files with 14 additions and 2 deletions

View File

@@ -58,6 +58,11 @@ export const authOptions: AuthOptions = {
},
async authorize(credentials, req) {
const csrfToken = req?.body?.csrfToken;
if (!csrfToken) {
console.error('CSRF token is missing from request');
return null;
}
const appClient = createAppClient({
ethereum: viemConnector(),
});
@@ -120,4 +125,11 @@ export const authOptions: AuthOptions = {
}
}
export const getSession = () => getServerSession(authOptions)
export const getSession = async () => {
try {
return await getServerSession(authOptions);
} catch (error) {
console.error('Error getting server session:', error);
return null;
}
}