File size: 313 Bytes
2e28042 |
1 2 3 4 5 6 7 8 9 10 |
import { HF_CLIENT_ID, HF_CLIENT_SECRET } from "$env/static/private";
export const requiresUser = !!HF_CLIENT_ID && !!HF_CLIENT_SECRET;
export const authCondition = (locals: App.Locals) => {
return locals.userId
? { userId: locals.userId }
: { sessionId: locals.sessionId, userId: { $exists: false } };
};
|