Dorji Tshering
Dorji Tshering
CCConvex Community
Created by Dorji Tshering on 8/15/2024 in #support-community
Password reset not working.
I have set up a password reset flow just like in the doc with resend api. Below is my resend config:
import Resend from "@auth/core/providers/resend";
import { alphabet, generateRandomString } from "oslo/crypto";
import { Resend as ResendAPI } from "resend";

export const ResendOTPPasswordReset = Resend({
id: "resend-otp",
apiKey: process.env.AUTH_RESEND_KEY,
async generateVerificationToken() {
return generateRandomString(8, alphabet("0-9"));
},
async sendVerificationRequest({ identifier: email, provider, token }) {
const resend = new ResendAPI(provider.apiKey);
const { error } = await resend.emails.send({
from: "Lhakhang Service <onboarding@resend.dev>",
to: [email],
subject: `Reset your password in Lhakhang Service`,
text: "Your password reset code is " + token,
});

if (error) {
throw new Error("Could not send");
}
},
});
import Resend from "@auth/core/providers/resend";
import { alphabet, generateRandomString } from "oslo/crypto";
import { Resend as ResendAPI } from "resend";

export const ResendOTPPasswordReset = Resend({
id: "resend-otp",
apiKey: process.env.AUTH_RESEND_KEY,
async generateVerificationToken() {
return generateRandomString(8, alphabet("0-9"));
},
async sendVerificationRequest({ identifier: email, provider, token }) {
const resend = new ResendAPI(provider.apiKey);
const { error } = await resend.emails.send({
from: "Lhakhang Service <onboarding@resend.dev>",
to: [email],
subject: `Reset your password in Lhakhang Service`,
text: "Your password reset code is " + token,
});

if (error) {
throw new Error("Could not send");
}
},
});
.
14 replies
CCConvex Community
Created by Dorji Tshering on 8/13/2024 in #support-community
Convex auth `signOut` does not delete auth cookies like authJWT and refresh tokens in production
When a user signs out in production with the convex auth signOut function, the auth related cookies are not getting removed from cookie storage, whereas during development mode(on localhost), the cookies gets removed. Because of that after signing out in production if i refresh the page, the users remains as authenticated which is not what one would expect. Even it passes from middleware to protected routes which i believe is because the cookies are still there. Is this expected or do i need to do some extra steps while logging out?
12 replies