Commit 6270b6a6 authored by Larbi Gharib's avatar Larbi Gharib
Browse files

Fix username null

Change-Id: I585a2d3d338c89def3616431793a727210115c99
parent 6c02a0dc
......@@ -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("/");
......
......@@ -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 {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment