Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running without auth bug fix #93

Merged
merged 1 commit into from
Nov 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions tornjak-frontend/src/components/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ class NavigationBar extends Component<NavigationBarProp, NavigationBarState> {
}

render() {
const isAdmin = this.TornjakHelper.checkRolesAdminUser(this.props.globalUserRoles);
const isAdmin = this.TornjakHelper.checkRolesAdminUser(this.props.globalUserRoles), withAuth = process.env.REACT_APP_AUTH_SERVER_URI;
let managerNavs;
console.log(process.env.REACT_APP_AUTH_SERVER_URI)
managerNavs =
<div className="dropdown">
<a href="/server/manage" className="dropbtn">Manage Servers</a>
Expand All @@ -81,7 +82,7 @@ class NavigationBar extends Component<NavigationBarProp, NavigationBarState> {
<a href="/clusters" className="dropbtn">Clusters </a>
<div className="dropdown-content">
<a href="/clusters" className="nav-link">Clusters List</a>
{isAdmin &&
{(isAdmin || (withAuth === undefined)) &&
<a href="/cluster/clustermanagement" className="nav-link">Cluster Management</a>
}
</div>
Expand All @@ -90,7 +91,7 @@ class NavigationBar extends Component<NavigationBarProp, NavigationBarState> {
<a href="/agents" className="dropbtn">Agents </a>
<div className="dropdown-content">
<a href="/agents" className="nav-link">Agents List</a>
{isAdmin &&
{(isAdmin || (withAuth === undefined)) &&
<a href="/agent/createjointoken" className="nav-link">Create Token</a>
}
</div>
Expand All @@ -99,7 +100,7 @@ class NavigationBar extends Component<NavigationBarProp, NavigationBarState> {
<a href="/entries" className="dropbtn">Entries</a>
<div className="dropdown-content">
<a href="/entries" className="nav-link">Entries List</a>
{isAdmin &&
{(isAdmin || (withAuth === undefined)) &&
<a href="/entry/create" className="nav-link">Create Entries</a>
}
</div>
Expand Down