MCPcopy Create free account
hub / github.com/flatlogic/react-material-admin / verifyEmail

Function verifyEmail

src/context/UserContext.js:299–322  ·  view source on GitHub ↗
(token, navigate)

Source from the content-addressed store, hash-verified

297}
298
299export 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
324export function resetPassword(token, password, navigate) {
325 return (dispatch) => {

Callers 1

VerifyFunction · 0.90

Calls 1

showSnackbarFunction · 0.90

Tested by

no test coverage detected