From 7658007d67c5c2bc1d81bff4bf972b315cb5bea6 Mon Sep 17 00:00:00 2001 From: sebdet Date: Sun, 23 Feb 2020 09:31:04 -0800 Subject: Simplify the user management Simplify the user management and fix a bug in the server, crashing when no user are logged and an operation is requested, and also previous user still stored in the securitycontext when admin is logged (due to static variable) Issue-ID: CLAMP-651 Change-Id: I57523bc2c3afaf5ca5a3acf5c59823df06fd4cd9 Signed-off-by: sebdet --- ui-react/src/api/UserService.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ui-react/src/api') diff --git a/ui-react/src/api/UserService.js b/ui-react/src/api/UserService.js index 8da6e3a71..5703fdcc7 100644 --- a/ui-react/src/api/UserService.js +++ b/ui-react/src/api/UserService.js @@ -74,7 +74,7 @@ export default class UserService { } static getUserInfo() { - return fetch('/restservices/clds/v1/clds/cldsInfo', { + return fetch('/restservices/clds/v2/clampInformation', { method: 'GET', credentials: 'same-origin' }) @@ -82,6 +82,8 @@ export default class UserService { console.debug("getUserInfo response received, status code:", response.status); if (response.ok) { return response.json(); + } else { + return {} } }) .then(function (data) { @@ -91,7 +93,7 @@ export default class UserService { .catch(function(error) { console.warn("getUserInfo error received, user set to: ",UserService.notLoggedUserName); console.error("getUserInfo error:",error); - return; + return {}; }); } } -- cgit 1.2.3-korg