diff --git a/jams-react-client/src/layouts/SignIn.js b/jams-react-client/src/layouts/SignIn.js index 322dde147f7ba07c69f67dad822f6cf9df4d65db..fb110b7d76e6044c5a29713bf6f3fc9745019b5e 100644 --- a/jams-react-client/src/layouts/SignIn.js +++ b/jams-react-client/src/layouts/SignIn.js @@ -27,7 +27,7 @@ function Copyright() { <Typography variant="body2" color="textSecondary" align="center"> {"Copyright © "} {new Date().getFullYear() + " "} - <Link color="info" href="https://savoirfairelinux.com"> + <Link href="https://savoirfairelinux.com"> Savoir-faire Linux Inc. </Link>{" "} {"."} @@ -77,7 +77,9 @@ export default function SignIn(props) { if(auth.hasAdminScope()) history.push("/users"); else { - history.push(`/user/${auth.getUsername()}`); + if(auth.getUsername() !== null) { + history.push(`/user/${auth.getUsername()}`); + } } } }); @@ -95,7 +97,9 @@ export default function SignIn(props) { if(auth.hasAdminScope()) history.push("/users"); else { - history.push(`/user/${auth.getUsername()}`); + if(auth.getUsername() !== null) { + history.push(`/user/${auth.getUsername()}`); + } } } else { history.push("/"); diff --git a/jams-react-client/src/protected.route.js b/jams-react-client/src/protected.route.js index 49810b918985bd9e0c167a8663aea56d7c5ecd00..35eeb0eb27e802bdbf6762fa709b4622bdd7d514 100644 --- a/jams-react-client/src/protected.route.js +++ b/jams-react-client/src/protected.route.js @@ -7,7 +7,7 @@ export const ProtectedRoute = ({ component: Component, ...rest }) => { <Route {...rest} render={ (props) => { - if (auth.isAuthenticated() && auth.hasAdmin() && auth.isInstalled()) { + if (auth.isAuthenticated() && auth.isInstalled()) { return <Component {...props} /> } else {