From 318c736083a8c6435cdd0f79fb7dcabaaf10e149 Mon Sep 17 00:00:00 2001 From: Julius Gruber Date: Wed, 26 Jun 2019 10:13:33 +0200 Subject: [PATCH] Added translation for Shibboleth button --- resources/i18n/en.json | 11 ++++------- src/app/core/auth/auth.interceptor.ts | 2 ++ src/app/core/auth/auth.reducer.ts | 1 + src/app/core/auth/models/auth-shibb.model.ts | 5 ----- src/app/shared/log-in/log-in.component.html | 4 ++-- 5 files changed, 9 insertions(+), 14 deletions(-) delete mode 100644 src/app/core/auth/models/auth-shibb.model.ts diff --git a/resources/i18n/en.json b/resources/i18n/en.json index 053c810964..1ae27630a1 100644 --- a/resources/i18n/en.json +++ b/resources/i18n/en.json @@ -538,7 +538,7 @@ } }, "switch-configuration": { - "title":"Show" + "title": "Show" }, "view-switch": { "show-list": "Show as list", @@ -930,7 +930,8 @@ "forgot-password": "Have you forgotten your password?", "new-user": "New user? Click here to register.", "password": "Password", - "submit": "Log in" + "submit": "Log in", + "ssoLogin": "Shibboleth" } }, "logout": { @@ -980,7 +981,7 @@ "no-results": "No {{ type }} found" }, "submission": { - "general":{ + "general": { "cannot_submit": "You have not the privilege to make a new submission.", "deposit": "Deposit", "discard": { @@ -1002,10 +1003,8 @@ "title": "Edit Submission" }, "mydspace": { - }, "sections": { - "general": { "add-more": "Add more", "no-sections": "No options available", @@ -1030,7 +1029,6 @@ "submit.progressbar.license": "Deposit license", "submit.progressbar.cclicense": "Creative commons license", "submit.progressbar.detect-duplicate": "Potential duplicates", - "upload": { "no-entry": "No", "no-file-uploaded": "No file uploaded yet.", @@ -1096,7 +1094,6 @@ "reject_help": "If you have reviewed the item and found it is not suitable for inclusion in the collection, select \"Reject\". You will then be asked to enter a message indicating why the item is unsuitable, and whether the submitter should change something and resubmit.", "return": "Return to pool", "return_help": "Return the task to the pool so that another user may perform the task." - }, "pool": { "claim": "Claim", diff --git a/src/app/core/auth/auth.interceptor.ts b/src/app/core/auth/auth.interceptor.ts index a3e3da6973..806ebc6a6b 100644 --- a/src/app/core/auth/auth.interceptor.ts +++ b/src/app/core/auth/auth.interceptor.ts @@ -174,7 +174,9 @@ export class AuthInterceptor implements HttpInterceptor { // console.log('error: ', error); let location = ''; if (error.headers.get('www-authenticate') != null && error.headers.get('www-authenticate').includes('shibboleth realm')) { + location = this.getShibbUrlFromHeader(error.headers); + console.log('shibb url from header: ', location); } // Create a new HttpResponse and return it, so it can be handle properly by AuthService. const authResponse = new HttpResponse({ diff --git a/src/app/core/auth/auth.reducer.ts b/src/app/core/auth/auth.reducer.ts index e9281321f1..f39421f1b1 100644 --- a/src/app/core/auth/auth.reducer.ts +++ b/src/app/core/auth/auth.reducer.ts @@ -200,6 +200,7 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut // next three cases are used by shibboleth login case AuthActionTypes.RETRIEVE_AUTH_METHODS: + console.log(' case AuthActionTypes.RETRIEVE_AUTH_METHODS'); return Object.assign({}, state, { loading: true }); diff --git a/src/app/core/auth/models/auth-shibb.model.ts b/src/app/core/auth/models/auth-shibb.model.ts deleted file mode 100644 index 1375baf09b..0000000000 --- a/src/app/core/auth/models/auth-shibb.model.ts +++ /dev/null @@ -1,5 +0,0 @@ -export class AuthShibbModel { - host: string; - target: string; - startShibSessionUrl: string; // as configured in backend -} diff --git a/src/app/shared/log-in/log-in.component.html b/src/app/shared/log-in/log-in.component.html index 5d2b2cab36..6757274a21 100644 --- a/src/app/shared/log-in/log-in.component.html +++ b/src/app/shared/log-in/log-in.component.html @@ -25,9 +25,9 @@ - +
-
{{"login.form.or-divider" | translate}}
+ {{"login.form.ssoLogin" | translate}}