diff options
author | sebdet <sebastien.determe@intl.att.com> | 2019-07-15 17:26:18 +0200 |
---|---|---|
committer | sebdet <sebastien.determe@intl.att.com> | 2019-07-16 23:23:58 +0200 |
commit | 493c3839fb6807512218165fd8a3a6efe1933fb9 (patch) | |
tree | d5b71a3a1fc554270ae6b4ec138058fb378a732d /ui-react/src/api/UserService.js | |
parent | 8bd462f6dc4a714b1680cb11f525c05445d3da33 (diff) |
SVG Rendering
SVG rendering draft for Config and operational policies management +
call to back-end
Issue-ID: CLAMP-422
Change-Id: Ia3ca4223e283d0cd56d98fb1871fd3b2880940ec
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Diffstat (limited to 'ui-react/src/api/UserService.js')
-rw-r--r-- | ui-react/src/api/UserService.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/ui-react/src/api/UserService.js b/ui-react/src/api/UserService.js index 814539551..8f53d7b8a 100644 --- a/ui-react/src/api/UserService.js +++ b/ui-react/src/api/UserService.js @@ -22,28 +22,29 @@ */ export default class UserService { - - static LOGIN() { + static notLoggedUserName='Anonymous'; + static login() { return fetch('/restservices/clds/v1/user/getUser', { method: 'GET', credentials: 'include', }) .then(function (response) { + console.debug("getUser response received, status code:", response.status); if (response.ok) { - console.log("getUser response received: ", response.status); return response.text(); } else { - console.error("getUser failed with status code: ",response.status); - return "Anonymous"; + console.error("getUser response is nok"); + return UserService.notLoggedUserName; } }) .then(function (data) { - console.log ("User connected:",data) + console.info ("User connected:",data) return data; }) .catch(function(error) { - console.error("getUser error received",error); - return "Anonymous"; + console.warn("getUser error received, user set to: ",UserService.notLoggedUserName); + console.error("getUser error:",error); + return UserService.notLoggedUserName; }); } } |