export async function resetPassword()

in src/Frontend/src/services/auth.ts [144:159]


export async function resetPassword(token : string, password : string) : Promise<Boolean> {
    return new Promise<Boolean>(async (resolve, reject) => {
        try {
            api.post(ENDPOINT_AUTH_RESET, { token, password }).then(response => {
                AlertInstance.alert(ALERT_SUCCESS, 'toast.success.auth.success_reset_password');
                resolve(true);
            }).catch((error: any) => {
                if (process.env.NODE_ENV === 'development') console.error('API ERROR RESET PASSWORD: ' + error);
                reject(false);
            });       
        } catch (e) {
            if (process.env.NODE_ENV === 'development') console.error('PROMISE ERROR: ' + e);
            reject(false);
        }
    });
}