Skip to content

Commit

Permalink
Add trailing slash to redirect url
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonNoad committed Jun 4, 2019
1 parent bab9141 commit 85b6845
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/app/components/PrivateRoute/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const PrivateRoute = ({ session, component: Component, ...rest }) => {
const ouraAuth = new ClientOAuth2({
clientId: process.env.GATSBY_OURA_APP_CLIENT_ID,
authorizationUri: process.env.GATSBY_OURA_OAUTH2_AUTHORIZE_URL,
redirectUri: `${process.env.GATSBY_BASE_URL}/app`,
redirectUri: `${process.env.GATSBY_BASE_URL}/app/`,
scopes: ['email', 'personal', 'daily']
// TODO: add state
});
Expand All @@ -31,8 +31,6 @@ const PrivateRoute = ({ session, component: Component, ...rest }) => {
// May be undefined.
const { accessToken } = await ouraAuth.token.getToken(window.location.href);

console.log(accessToken);

if (accessToken === undefined) {
throw new Error('Invalid access token');
}
Expand All @@ -41,7 +39,6 @@ const PrivateRoute = ({ session, component: Component, ...rest }) => {

window.location.hash = '';
} catch (e) {
console.log(e);
// Redirect users to log in to Oura and authorize this app.
window.location.href = ouraAuth.token.getUri();
}
Expand Down

0 comments on commit 85b6845

Please sign in to comment.