Skip to main content

forgotPassword

talawa-api


talawa-api / resolvers/Mutation/forgotPassword / forgotPassword

Variable: forgotPassword

> const forgotPassword: MutationResolvers["forgotPassword"]

This function enables a user to restore password.

Param

parent of current request

Param

payload provided with the request

Remarks

The following tasks are done:

  1. Extracts email and otp out of otpToken.
  2. Compares otpToken and otp.
  3. Checks whether otp is valid.
  4. Updates password field for user's document with email === email.

Returns

True if the operation is successful.

Defined in

src/resolvers/Mutation/forgotPassword.ts:23