Reset password with express #4464
Replies: 1 comment
-
Please open this issue with clerk support instead! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to try to implement reset password of clerk with express, but it's not working.
`
async resetPasswordRequest(email: string) {
try {
const user = await this.userRepository.findOne({ where: { email } })
if (!user) {
throw new AppError(404, 'User not found')
}
}
async resetPassword(code: string, newPassword: string) {
try {
// Create a sign-in attempt
const signInAttempt = await clerk.signIns.create({
strategy: 'reset_password_email_code',
})
}
`
and this is my clerk.ts file code:
`
import { createClerkClient } from '@clerk/backend'
import { clerkMiddleware, requireAuth } from '@clerk/express'
import dotenv from 'dotenv'
dotenv.config()
if (!process.env.CLERK_SECRET_KEY) {
throw new Error('CLERK_SECRET_KEY is not set in environment variables')
}
// Initialize Clerk client for API operations
export const clerk = createClerkClient({
secretKey: process.env.CLERK_SECRET_KEY,
})
// Export middleware
export const clerkAuth = clerkMiddleware()
export { requireAuth }
`
I tried a lot's of way but i couldn't find any solution.
Beta Was this translation helpful? Give feedback.
All reactions