Fix Hacky Fallback in Auth Query #4
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Where:
src/lib/auth.ts->getSession()Why: Querying the DB with a fallback UUID (
eaf930...) when email is missing is an anti-pattern.Fix: Implement an early return (
if (!session?.user?.email) return null;) before hitting the database.