forgotPassword
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:
- Extracts email and otp out of otpToken.
- Compares otpToken and otp.
- Checks whether otp is valid.
- Updates password field for user's document with email === email.
Returns
True if the operation is successful.