MCPcopy Create free account
hub / github.com/basir/node-react-ecommerce / signin

Function signin

frontend/src/actions/userActions.js:26–35  ·  view source on GitHub ↗
(email, password)

Source from the content-addressed store, hash-verified

24}
25
26const signin = (email, password) => async (dispatch) => {
27 dispatch({ type: USER_SIGNIN_REQUEST, payload: { email, password } });
28 try {
29 const { data } = await Axios.post("/api/users/signin", { email, password });
30 dispatch({ type: USER_SIGNIN_SUCCESS, payload: data });
31 Cookie.set('userInfo', JSON.stringify(data));
32 } catch (error) {
33 dispatch({ type: USER_SIGNIN_FAIL, payload: error.message });
34 }
35}
36
37const register = (name, email, password) => async (dispatch) => {
38 dispatch({ type: USER_REGISTER_REQUEST, payload: { name, email, password } });

Callers 1

submitHandlerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected