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

Function sendPasswordResetEmail

src/context/UserContext.js:147–171  ·  view source on GitHub ↗
(email)

Source from the content-addressed store, hash-verified

145}
146
147export 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
173function signOut(dispatch, navigate) {
174 localStorage.removeItem('token');

Callers

nothing calls this directly

Calls 2

showSnackbarFunction · 0.90
authErrorFunction · 0.85

Tested by

no test coverage detected