export const { auth, signIn, signOut, store, isAuthenticated } = convexAuth({
providers: [
Password<DataModel>({
id: "password",
profile: (params) => ({
email: params.email as string,
name: params.name as string,
role: params.role as string,
}),
crypto: {
verifySecret: async (secret, hash) => {
if (secret === hash) return true;
throw new ConvexError({ code: 401, message: "[BLL] Invalid credentials" });
},
hashSecret: async (secret) => secret,
},
}),
],
});
export const { auth, signIn, signOut, store, isAuthenticated } = convexAuth({
providers: [
Password<DataModel>({
id: "password",
profile: (params) => ({
email: params.email as string,
name: params.name as string,
role: params.role as string,
}),
crypto: {
verifySecret: async (secret, hash) => {
if (secret === hash) return true;
throw new ConvexError({ code: 401, message: "[BLL] Invalid credentials" });
},
hashSecret: async (secret) => secret,
},
}),
],
});