Skip to content
Snippets Groups Projects
Commit 87a84608 authored by Philippe Larose's avatar Philippe Larose
Browse files

jams-react-client: Added checks to prevent admin api call in user authenticated state

Ticket: https://redmine.savoirfairelinux.com/issues/7436
Change-Id: Ib10183a524a0ae96373c9ff1151ecaa09ed66c05
parent 1771740f
No related branches found
No related tags found
No related merge requests found
......@@ -203,6 +203,9 @@ class Auth {
}
checkForUpdates(cb: () => void) {
if (!this.hasAdminScope()) {
return;
}
if (this.installed && this.authenticated) {
axios(configApiCall(api_path_get_subscription_status, "GET", null, null))
.then((response) => {
......
......@@ -271,6 +271,9 @@ const DisplayUserProfile: FC<DisplayUserProfileProps> = ({
const getAdminUserGroups = () => {
// TODO do this in a single sql query on the server, with a JOIN
if (!auth.hasAdminScope()) {
return;
}
axios(
configApiCall(
api_path_get_admin_user_groups + username,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment