fix: simplify form styles and handle missing auth config
- Remove excessive form styling, keep minimal - Wrap getSession in try-catch for dev without env vars
This commit is contained in:
parent
892afc2161
commit
3600897f4b
2 changed files with 8 additions and 34 deletions
|
|
@ -6,7 +6,12 @@ import { getPendingEntries, type GuestbookEntry } from '../lib/db';
|
|||
import { isAdmin } from '../lib/auth';
|
||||
import '../styles/global.css';
|
||||
|
||||
const session = await getSession(Astro.request);
|
||||
let session;
|
||||
try {
|
||||
session = await getSession(Astro.request);
|
||||
} catch {
|
||||
return new Response('Auth not configured', { status: 500 });
|
||||
}
|
||||
|
||||
if (!session) {
|
||||
return Astro.redirect('/api/auth/signin');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue