-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdebug-auth.ts
More file actions
30 lines (26 loc) · 948 Bytes
/
Copy pathdebug-auth.ts
File metadata and controls
30 lines (26 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { loadAppEnv } from './server/load-app-env';
loadAppEnv(process.cwd());
import { auth } from './app/lib/auth';
const email = process.env.DEBUG_AUTH_EMAIL || process.env.BOOTSTRAP_ADMIN_EMAIL || 'admin@example.com';
const password = process.env.DEBUG_AUTH_PASSWORD || process.env.BOOTSTRAP_ADMIN_PASSWORD || 'change-me';
async function testLogin() {
console.log('Attempting login...');
try {
const res = await auth.api.signInEmail({
body: {
email,
password
}
});
console.log('Login result:', res);
} catch (error: unknown) {
console.error('Login error details:', error);
if (error && typeof error === 'object' && 'cause' in error) {
console.error('Cause:', (error as { cause?: unknown }).cause);
}
if (error && typeof error === 'object' && 'stack' in error) {
console.error('Stack:', (error as { stack?: unknown }).stack);
}
}
}
testLogin();