mirror of
https://github.com/elder-plinius/LEAKHUB.git
synced 2026-02-12 16:52:53 +00:00
23 lines
574 B
TypeScript
23 lines
574 B
TypeScript
import GitHub from "@auth/core/providers/github";
|
|
import { convexAuth } from "@convex-dev/auth/server";
|
|
|
|
export const { auth, signIn, signOut, store, isAuthenticated } = convexAuth({
|
|
providers: [GitHub],
|
|
callbacks: {
|
|
async createOrUpdateUser(ctx, args) {
|
|
if (args.existingUserId) {
|
|
return args.existingUserId;
|
|
}
|
|
|
|
return await ctx.db.insert("users", {
|
|
email: args.profile.email,
|
|
name: args.profile.name,
|
|
image: args.profile.image,
|
|
points: 0,
|
|
requests: [],
|
|
leaks: [],
|
|
});
|
|
},
|
|
},
|
|
});
|