Add reset password & UI change

This commit is contained in:
Qolzam
2017-11-12 15:31:54 +07:00
parent 9ffd6a1e40
commit 55789967eb
22 changed files with 731 additions and 374 deletions

View File

@@ -107,6 +107,28 @@ export const dbUpdatePassword = (newPassword: string) => {
}
}
/**
* Reset user's password
* @param {string} newPassword
*/
export const dbResetPassword = (email: string) => {
return (dispatch: any, getState: any) => {
dispatch(globalActions.showNotificationRequest())
return authorizeService.resetPassword(email).then(() => {
// Reset password successful.
dispatch(globalActions.showNotificationSuccess())
dispatch(push('/login'))
})
.catch((error: SocialError) => {
// An error happened.
dispatch(globalActions.showErrorMessage(error.code))
})
}
}
/* _____________ CRUD State _____________ */
/**