Skip to content
This repository was archived by the owner on Aug 1, 2021. It is now read-only.

Commit e994cca

Browse files
committed
auth
1 parent fe77f7d commit e994cca

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

src/Frontend/Jp.AdminUI/src/app/core/auth/auth-config.prod.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { AuthConfig } from 'angular-oauth2-oidc';
21
import { environment } from '@env/environment';
2+
import { AuthConfig } from 'angular-oauth2-oidc';
33

44
export const authProdConfig: AuthConfig = {
55
issuer: environment.IssuerUri,
66
clientId: 'IS4-Admin',
77
requireHttps: environment.RequireHttps,
88
redirectUri: environment.Uri + "/login-callback",
99
silentRefreshRedirectUri: environment.Uri + '/silent-refresh.html',
10-
scope: "openid profile email jp_api.is4",
10+
scope: "openid profile email jp_api.is4 role",
1111
sessionChecksEnabled: true,
1212
clearHashAfterLogin: false, // https://github.com/manfredsteyer/angular-oauth2-oidc/issues/457#issuecomment-431807040
1313
waitForTokenInMsec: 5000

src/Frontend/Jp.AdminUI/src/app/shared/viewModel/default-response.model.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export class ProblemDetails {
2-
2+
33
public success: boolean;
44

55
public static GetErrors(err: any): Array<KeyValuePair> {
@@ -8,14 +8,19 @@ export class ProblemDetails {
88
return [new KeyValuePair("403", "Unauthorized Access")];
99
}
1010

11-
if (err.error.errors)
12-
{
13-
if(err.error.errors["DomainNotification"]){
11+
if (err.error.errors) {
12+
if (err.error.errors["DomainNotification"]) {
1413
return err.error.errors["DomainNotification"].map((element, i) => new KeyValuePair(i, element));
1514
}
16-
return err.error.errors.map((element, i) => new KeyValuePair(i, element.message));
15+
if (Array.isArray(err.error.errors)) { return err.error.errors.map((element, i) => new KeyValuePair(i, element.message)); }
16+
17+
var mappedErrors = [];
18+
Object.keys(err.error.errors).map(function (key, index) {
19+
mappedErrors.push(new KeyValuePair(key, err.error.errors[key]))
20+
});
21+
return mappedErrors;
1722
}
18-
23+
1924

2025

2126
return [new KeyValuePair(err.error.status.toString(), "Unknown error - " + err.error.type)];

0 commit comments

Comments
 (0)