google login
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import usersService from '../../../services/UsersService';
|
||||
import {updateUserDetails} from "../../../store/UserDetails";
|
||||
import { useDispatch } from "react-redux";
|
||||
|
||||
function Redirect() {
|
||||
const location = useLocation();
|
||||
@@ -40,11 +42,12 @@ function Redirect() {
|
||||
return;
|
||||
}
|
||||
|
||||
userApi.CompleteOauthLogin(res.data).then( (logRes)=>{
|
||||
console.log("OUATH FROm BACKEND",logRes);
|
||||
} )
|
||||
// "{"message":"Endpoint not found.","URI":"http:\/\/localhost:9083\/index.php\/en\/wrench\/api\/v1\/authstart"}[]"
|
||||
//alert(JSON.stringify(res.data));
|
||||
localStorage.setItem("member_id", `${res.data.member_id}`);
|
||||
localStorage.setItem("uid", `${res.data.uid}`);
|
||||
localStorage.setItem("session_token", `${res.data.session}`);
|
||||
// localStorage.setItem("session", `${res.data.session}`);
|
||||
dispatch(updateUserDetails({...res.data, loggedIn:true}));
|
||||
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
|
||||
Reference in New Issue
Block a user