diff --git a/src/server/API/API.csproj b/src/server/API/API.csproj
index b1fc4c57e..93c8f5723 100644
--- a/src/server/API/API.csproj
+++ b/src/server/API/API.csproj
@@ -3,7 +3,7 @@
netcoreapp2.1
true
true
- 3.1.1
+ 3.1.3
latest
diff --git a/src/ui-client/package.json b/src/ui-client/package.json
index 8aed9f975..1c6c64e98 100644
--- a/src/ui-client/package.json
+++ b/src/ui-client/package.json
@@ -1,6 +1,6 @@
{
"name": "ui-client",
- "version": "3.1.1",
+ "version": "3.1.3",
"private": true,
"dependencies": {
"@types/d3-format": "^1.3.0",
diff --git a/src/ui-client/src/actions/auth.ts b/src/ui-client/src/actions/auth.ts
index 92c44a447..94011d19b 100644
--- a/src/ui-client/src/actions/auth.ts
+++ b/src/ui-client/src/actions/auth.ts
@@ -34,10 +34,17 @@ export const getIdToken = () => {
dispatch(receiveAuthConfig(config));
// Get user id token
- getUserTokenAndContext(config).then((token) => {
- dispatch(setRouteConfig(getRoutes(config, token)));
- dispatch(receiveIdToken(token));
- });
+ getUserTokenAndContext(config)
+ .then((token) => {
+ dispatch(setRouteConfig(getRoutes(config, token)));
+ dispatch(receiveIdToken(token));
+ })
+ .catch((reason) => {
+ attemptLoginRetryIfPossible();
+ console.log(reason);
+ const message = "Hmm... The Leaf server doesn't seem to be responding. Please contact your Leaf administrator.";
+ dispatch(failureIdToken(message));
+ });
}, error => {
attemptLoginRetryIfPossible();
console.log(error);
diff --git a/src/ui-client/src/containers/Header/Header.css b/src/ui-client/src/containers/Header/Header.css
index d1f783231..1b09331e1 100644
--- a/src/ui-client/src/containers/Header/Header.css
+++ b/src/ui-client/src/containers/Header/Header.css
@@ -20,7 +20,7 @@
}
.header-content-side {
- width: 30%;
+ width: 35%;
}
.header-content-side-right {
diff --git a/src/ui-client/src/models/Auth.ts b/src/ui-client/src/models/Auth.ts
index 34cee9622..bfdf014d3 100644
--- a/src/ui-client/src/models/Auth.ts
+++ b/src/ui-client/src/models/Auth.ts
@@ -69,6 +69,7 @@ export interface UserContext {
name: string;
rawDecoded: DecodedIdToken;
roles: string[];
+ scope: string;
token: string;
version: string;
}
diff --git a/src/ui-client/src/services/authApi.ts b/src/ui-client/src/services/authApi.ts
index 931144fe5..b8404a687 100644
--- a/src/ui-client/src/services/authApi.ts
+++ b/src/ui-client/src/services/authApi.ts
@@ -24,7 +24,15 @@ const getIdTokenKey = (config: AuthConfig) => {
const decodeToken = (token: string): UserContext => {
const decoded = jwt_decode(token) as DecodedIdToken;
const roles = decoded['http://schemas.microsoft.com/ws/2008/06/identity/claims/role'];
- const name = decoded['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name'];
+ const fullname = decoded['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name'];
+ const nameSplit = fullname.split('@');
+ let name = fullname;
+ let scope = '';
+
+ if (nameSplit.length === 2) {
+ name = nameSplit[0];
+ scope = nameSplit[1];
+ }
const ctx: UserContext = {
expirationDate: new Date(decoded.exp * 1000),
@@ -37,6 +45,7 @@ const decodeToken = (token: string): UserContext => {
name,
rawDecoded: decoded,
roles,
+ scope,
token,
version: decoded['leaf-version']
}
diff --git a/src/ui-client/src/services/sessionApi.ts b/src/ui-client/src/services/sessionApi.ts
index 8bb871691..6db623a7d 100644
--- a/src/ui-client/src/services/sessionApi.ts
+++ b/src/ui-client/src/services/sessionApi.ts
@@ -125,7 +125,7 @@ export const attemptLoginRetryIfPossible = () => {
const retry = sessionStorage.getItem(key);
if (!retry) {
sessionStorage.setItem(key, 'X');
- window.location = window.location;
+ window.location.reload(true);
} else {
sessionStorage.removeItem(key);
}