Ignore:
Timestamp:
08/30/24 15:44:27 (4 weeks ago)
Author:
223021 <daniel.ilievski.2@…>
Branches:
main
Parents:
0f0add0
Message:

Implemented Google login, additional file uploads, response messages and email notifications

File:
1 edited

Legend:

Unmodified
Added
Removed
  • jobvista-frontend/src/redux/actions/authActions.js

    r0f0add0 r4d97b63  
    3232            }).catch((error) => {
    3333                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);
    3460            });
    3561        };
Note: See TracChangeset for help on using the changeset viewer.