diff --git a/src/App.js b/src/App.js index 96fcaca9a3e0c03ec95e1414350360d6a649f3ea..9e7ce9cd15c530a2be4a293ef24ed00778ae850f 100644 --- a/src/App.js +++ b/src/App.js @@ -69,7 +69,7 @@ export default function App(){ <Header /> <div style={{backgroundImage: "linear-gradient(to right,#ff7f00,#e81f4f,#673ab7,#00bcd4)", height:"5px"}}></div> <Switch> - <Route path="/" exact={true} component={Home}/> + <Route path="/home" exact={true} component={Home}/> <Route path="/busca" component={Search} /> <Route path="/perfil-atualizacoes" component={UserPage} /> <Route path="/recurso" component={ResourcePage}/> diff --git a/src/Components/LoginContainer.js b/src/Components/LoginContainer.js index 3249880ea50be7279888f07d19b3fcd0e6938878..c8b2c76f466fab78050378933de8b583f4ce0121 100644 --- a/src/Components/LoginContainer.js +++ b/src/Components/LoginContainer.js @@ -37,9 +37,17 @@ const responseGoogle = (response) => { (error) => {console.log(error)} ) } -const handleGoogle = () => { - axios.get('https://api.portalmec.c3sl.ufpr.br/v1/omniauth/google_oauth2?auth_origin_url=https://api.portalmec.c3sl.ufpr.br/v1/auth/google_auth2&omniauth_window_type=sameWindow&resource_class=User').then((res) => {console.log(res)}, (err) => {console.log(err)}) +async function handleGoogle () { + try { + const response = await axios.get('https://api.portalmec.c3sl.ufpr.br/v1/omniauth/google_oauth2?auth_origin_url=https://api.portalmectest.c3sl.ufpr.br/react/&omniauth_window_type=sameWindow&resource_class=User'); + console.log(response); + const url = await response.text; + window.location.assign(url); + } catch(e) { + console.log(e) + } } + class LoginContainer extends Component { constructor (props) { super(props);