Changeset 4d97b63 for jobvista-frontend/src/redux/actions/authActions.js
- Timestamp:
- 08/30/24 15:44:27 (4 weeks ago)
- Branches:
- main
- Parents:
- 0f0add0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
jobvista-frontend/src/redux/actions/authActions.js
r0f0add0 r4d97b63 32 32 }).catch((error) => { 33 33 callback(false, error); 34 }); 35 }; 36 }, 37 38 signInGoogle: (tokenId, callback) => { 39 return dispatch => { 40 axios.post("/auth/google", { tokenId }) 41 .then(jwtResponse => { 42 const response = jwtResponse.data; 43 const token = response.token; 44 const user = { 45 name: response.name, 46 role: response.role, 47 access: response.hasAccess, 48 id: response.id, 49 }; 50 dispatch({ 51 type: SIGN_IN, 52 payload: { 53 token, 54 user 55 } 56 }); 57 callback && callback(true); 58 }).catch(error => { 59 callback && callback(false, error); 34 60 }); 35 61 };
Note:
See TracChangeset
for help on using the changeset viewer.