[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[reclaim-ui] 403/459: update state loading
From: |
gnunet |
Subject: |
[reclaim-ui] 403/459: update state loading |
Date: |
Fri, 11 Jun 2021 23:28:15 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository reclaim-ui.
commit f95cc3008b4128adad290da24521172cb83d2e03
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Tue Jan 5 16:13:58 2021 +0900
update state loading
---
src/app/edit-identity/edit-identity.component.ts | 10 ++++++++++
src/app/open-id.service.ts | 13 +++++++++++++
2 files changed, 23 insertions(+)
diff --git a/src/app/edit-identity/edit-identity.component.ts
b/src/app/edit-identity/edit-identity.component.ts
index 9e128bd..d9e011a 100644
--- a/src/app/edit-identity/edit-identity.component.ts
+++ b/src/app/edit-identity/edit-identity.component.ts
@@ -84,6 +84,10 @@ export class EditIdentityComponent implements OnInit {
this.loadImportScopesFromLocalStorage()
this.loadImportIdProviderFromLocalStorage();
this.importInProgress = true;
+ let oidcState = localStorage.getItem('oidcRequestState');
+ if (oidcState) {
+ this.oidcService.loadState(oidcState);
+ }
this.activatedRoute.params.subscribe(p => {
if (p['id'] === undefined) {
return;
@@ -623,6 +627,7 @@ export class EditIdentityComponent implements OnInit {
this.attributesToOverwriteOnImport = [];
localStorage.removeItem('importIdProviderURL');
localStorage.removeItem('credentialCode');
+ localStorage.removeItem('oidcRequestState');
localStorage.removeItem('importTargetComponent');
this.importInProgress = false;
this.oauthService.logOut();
@@ -653,6 +658,7 @@ export class EditIdentityComponent implements OnInit {
this.attributesToOverwriteOnImport = [];
localStorage.removeItem('importIdProviderURL');
localStorage.removeItem('credentialCode');
+ localStorage.removeItem('oidcRequestState');
localStorage.removeItem('importTargetComponent');
this.importInProgress = false;
this.oauthService.logOut();
@@ -810,6 +816,10 @@ export class EditIdentityComponent implements OnInit {
this.configureOauthService();
this.oauthService.logOut(); //Make sure we logout before login
localStorage.setItem('importTargetComponent', 'edit-identity');
+ /**
+ * Save current openid request state (if any)
+ */
+ localStorage.setItem('oidcRequestState', this.oidcService.getState());
this.oauthService.loadDiscoveryDocumentAndLogin();
}
diff --git a/src/app/open-id.service.ts b/src/app/open-id.service.ts
index 723397e..50e6466 100644
--- a/src/app/open-id.service.ts
+++ b/src/app/open-id.service.ts
@@ -52,6 +52,19 @@ export class OpenIdService {
this.inOidcFlow = this.params['redirect_uri'] !== undefined;
}
+ getState() {
+ return JSON.stringify(this.params);
+ }
+
+ loadState(state_string: string) {
+ try {
+ let state = JSON.parse(state_string);
+ this.parseRouteParams(state);
+ } catch(e) {
+ console.log("ERROR: unable to load state " + state_string + " " + e);
+ }
+ }
+
private buildAuthorizeRedirect(): any {
var redirectUri = this.config.get().apiUrl + '/openid/authorize';
redirectUri += '?client_id=' + this.params['client_id'];
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [reclaim-ui] 385/459: fix bugs with requested attributes, (continued)
- [reclaim-ui] 385/459: fix bugs with requested attributes, gnunet, 2021/06/11
- [reclaim-ui] 355/459: fix, gnunet, 2021/06/11
- [reclaim-ui] 375/459: blacklist some claims, gnunet, 2021/06/11
- [reclaim-ui] 378/459: update, gnunet, 2021/06/11
- [reclaim-ui] 379/459: minor, gnunet, 2021/06/11
- [reclaim-ui] 356/459: Merge branch 'master' of gitlab.com:reclaimid/ui, gnunet, 2021/06/11
- [reclaim-ui] 335/459: add template, gnunet, 2021/06/11
- [reclaim-ui] 391/459: fix requested attribute, gnunet, 2021/06/11
- [reclaim-ui] 363/459: fix radio button, gnunet, 2021/06/11
- [reclaim-ui] 362/459: missing credential source, gnunet, 2021/06/11
- [reclaim-ui] 403/459: update state loading,
gnunet <=
- [reclaim-ui] 361/459: authorization request dialog in identity list, gnunet, 2021/06/11
- [reclaim-ui] 370/459: build fix, gnunet, 2021/06/11
- [reclaim-ui] 364/459: fine tuning authorization, gnunet, 2021/06/11
- [reclaim-ui] 401/459: improve import logic and UI, gnunet, 2021/06/11
- [reclaim-ui] 320/459: works on chrome, gnunet, 2021/06/11
- [reclaim-ui] 342/459: Translated using Weblate (German), gnunet, 2021/06/11
- [reclaim-ui] 349/459: fix translations, gnunet, 2021/06/11
- [reclaim-ui] 387/459: update, gnunet, 2021/06/11
- [reclaim-ui] 358/459: clean up, gnunet, 2021/06/11
- [reclaim-ui] 386/459: fix import for browser plugin, other import may be broken, gnunet, 2021/06/11