(email)
| 145 | } |
| 146 | |
| 147 | export function sendPasswordResetEmail(email) { |
| 148 | return (dispatch) => { |
| 149 | if (!config.isBackend) { |
| 150 | return; |
| 151 | } else { |
| 152 | dispatch({ |
| 153 | type: 'PASSWORD_RESET_EMAIL_REQUEST', |
| 154 | }); |
| 155 | axios |
| 156 | .post('/auth/send-password-reset-email', { email }) |
| 157 | .then(() => { |
| 158 | dispatch({ |
| 159 | type: 'PASSWORD_RESET_EMAIL_SUCCESS', |
| 160 | }); |
| 161 | showSnackbar({ |
| 162 | type: 'success', |
| 163 | message: 'Email with resetting instructions has been sent', |
| 164 | }); |
| 165 | }) |
| 166 | .catch((err) => { |
| 167 | dispatch(authError(err.response.data)); |
| 168 | }); |
| 169 | } |
| 170 | }; |
| 171 | } |
| 172 | |
| 173 | function signOut(dispatch, navigate) { |
| 174 | localStorage.removeItem('token'); |
nothing calls this directly
no test coverage detected