Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created July 27, 2022 11:55
private async sendPasswordResetEmail(email: string): Promise<void> {
try {
const axiosResponse = await this.httpService
.post(
`https://${configService.getAuth0Domain()}/dbconnections/change_password`,
{
client_id: configService.getAuth0ClientId(),
client_secret: configService.getAuth0ClientSecret(),
connection: configService.getAuth0Connection(),
email,
},
)
.toPromise();
this.logger.log(email, 'Password reset email sent to');
return axiosResponse.data;
} catch (err) {
this.logger.error(err);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment