Back

Custom token Issue

  • 0
  • Web
elvin
19 Sep, 2024, 10:12

how do use a custom token and secrete for password recover.

`export const createToken = async (userId: string) => { try { const { user } = await createAdminClient(); const token = await user.createToken(userId); const secret = token.secret;

TypeScript
return { token, secret };

} catch (error) { console.error('Error creating token:', error); throw new Error('Unable to create token'); } };`

TL;DR
Developers want to know how to use a custom token and secret for password recovery. The code snippet provided demonstrates how to create a token using a custom token and secret.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more