mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-11-16 08:08:56 -05:00
feat: add more logging for error debugging
This commit is contained in:
parent
b3e419b1f6
commit
6c35293e80
@ -9,7 +9,7 @@ import { fileURLToPath } from 'url';
|
|||||||
dotenv.config({ path: '.env.local' });
|
dotenv.config({ path: '.env.local' });
|
||||||
|
|
||||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||||
const projectRoot = path.join(__dirname, '..');
|
const projectRoot = path.resolve(path.normalize(path.join(__dirname, '..')));
|
||||||
|
|
||||||
let tunnel;
|
let tunnel;
|
||||||
let nextDev;
|
let nextDev;
|
||||||
|
|||||||
14
src/auth.ts
14
src/auth.ts
@ -58,6 +58,11 @@ export const authOptions: AuthOptions = {
|
|||||||
},
|
},
|
||||||
async authorize(credentials, req) {
|
async authorize(credentials, req) {
|
||||||
const csrfToken = req?.body?.csrfToken;
|
const csrfToken = req?.body?.csrfToken;
|
||||||
|
if (!csrfToken) {
|
||||||
|
console.error('CSRF token is missing from request');
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
const appClient = createAppClient({
|
const appClient = createAppClient({
|
||||||
ethereum: viemConnector(),
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user