not even sure

This commit is contained in:
2025-09-20 09:49:54 -05:00
parent a8bbfebd00
commit d4d690eb15
10 changed files with 101 additions and 40 deletions

View File

@@ -10,9 +10,12 @@ import { type Id } from './_generated/dataModel';
import { action, mutation, query } from './_generated/server';
import Authentik from '@auth/core/providers/authentik';
import { Entra, Password, validatePassword } from './custom/auth';
import Resend from '@auth/core/providers/resend';
import { Resend as ResendAPI } from 'resend';
import { generateRandomString, RandomReader } from '@oslojs/crypto/random';
export const { auth, signIn, signOut, store, isAuthenticated } = convexAuth({
providers: [Password, Authentik, Entra],
providers: [Authentik, Entra, Password],
});
export const PASSWORD_MIN = 8;
@@ -172,3 +175,32 @@ export const updateUserPassword = action({
return { success: true };
},
});
//export const ResendOTPPasswordReset = Resend({
//id: "resend-otp",
//apiKey: process.env.AUTH_RESEND_KEY,
//async generateVerificationToken() {
//const random: RandomReader = {
//read(bytes) {
//crypto.getRandomValues(bytes);
//},
//};
//const alphabet = "0123456789";
//const length = 8;
//return generateRandomString(random, alphabet, length);
//},
//async sendVerificationRequest({ identifier: email, provider, token }) {
//const resend = new ResendAPI(provider.apiKey);
//const { error } = await resend.emails.send({
//from: "My App <onboarding@resend.dev>",
//to: [email],
//subject: `Reset your password in My App`,
//text: "Your password reset code is " + token,
//});
//if (error) {
//throw new Error("Could not send");
//}
//},
//});