How to verify password?

'use server'

import { authenticatedActionClient } from '@/lib/safe-action'
import { changeUsernameSchema } from './schema'

export const changeUsername = authenticatedActionClient
  .schema(changeUsernameSchema)
  .action(async ({ parsedInput }) => {
    const { username, password } = parsedInput

    // verify password
  })


Is there a function that I can use to verify the password? I want the user to type the current password to confirm before changing the username.
Solution
context.password.verify is the method you can use
Was this page helpful?