From 1e3333d3701f1b6bd4855735e6a597e2b7f6ac92 Mon Sep 17 00:00:00 2001 From: Lucas Schoenfelder <les17@inf.ufpr.br> Date: Thu, 20 Aug 2020 09:55:03 -0300 Subject: [PATCH] hm --- src/App.js | 2 +- src/Components/LoginContainer.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/App.js b/src/App.js index 96fcaca9..9e7ce9cd 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 3249880e..c8b2c76f 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); -- GitLab