Move Server-Only Code to $lib/server
#2
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.tsWhy: It imports from
./server/db. Keeping server-side dependencies in the general$libfolder risks accidental imports by client components, breaking the Vite build and potentially leaking server logic.Fix: Move and rename it to
src/lib/server/session.ts(orauthUtils.ts) and update imports in.server.tsfiles.