Added stuff idek

This commit is contained in:
2025-09-02 16:30:37 -05:00
parent 1d32d31550
commit 64b3b0a854
26 changed files with 1102 additions and 467 deletions

View File

@@ -1,6 +1,20 @@
import { convexAuth } from '@convex-dev/auth/server';
import { Password } from './CustomPassword';
import { convexAuth, getAuthUserId } from '@convex-dev/auth/server';
import { query } from './_generated/server';
import Password from './CustomPassword';
export const { auth, signIn, signOut, store, isAuthenticated } = convexAuth({
providers: [Password],
});
export const getUser = query(async (ctx) => {
const userId = await getAuthUserId(ctx);
if (!userId) return null;
const user = await ctx.db.get(userId);
if (!user) return null;
return {
id: user._id,
email: user.email ?? null,
name: user.name ?? null,
image: user.image ?? null,
}
});