(token, navigate)
| 297 | } |
| 298 | |
| 299 | export function verifyEmail(token, navigate) { |
| 300 | return () => { |
| 301 | if (!config.isBackend) { |
| 302 | navigate('/login'); |
| 303 | } else { |
| 304 | axios |
| 305 | .put('/auth/verify-email', { token }) |
| 306 | .then((verified) => { |
| 307 | if (verified) { |
| 308 | showSnackbar({ |
| 309 | type: 'success', |
| 310 | message: 'Your email was verified', |
| 311 | }); |
| 312 | } |
| 313 | }) |
| 314 | .catch((err) => { |
| 315 | showSnackbar({ type: 'error', message: err.response }); |
| 316 | }) |
| 317 | .finally(() => { |
| 318 | navigate('/login'); |
| 319 | }); |
| 320 | } |
| 321 | }; |
| 322 | } |
| 323 | |
| 324 | export function resetPassword(token, password, navigate) { |
| 325 | return (dispatch) => { |
no test coverage detected