From 19369712943cd8732d8599b0d46d39bff6c5c647 Mon Sep 17 00:00:00 2001 From: Lucas ONeil Date: Mon, 8 Jul 2024 14:46:52 -0700 Subject: [PATCH] "Back to" url Signed-off-by: Lucas ONeil --- .../src/components/base/BaseAuthButton.vue | 7 +++- docker/keycloak/config/keycloak_import.json | 2 +- .../api/templates/verified_credentials.html | 37 ++++++++++++++++--- 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/demo/vue/app/frontend/src/components/base/BaseAuthButton.vue b/demo/vue/app/frontend/src/components/base/BaseAuthButton.vue index c4a6412c..5674c85b 100644 --- a/demo/vue/app/frontend/src/components/base/BaseAuthButton.vue +++ b/demo/vue/app/frontend/src/components/base/BaseAuthButton.vue @@ -30,7 +30,10 @@ export default { login() { if (this.keycloakReady) { window.location.replace( - this.createLoginUrl() + '&pres_req_conf_id=' + this.presReqConfId + this.createLoginUrl() + + '&pres_req_conf_id=' + + this.presReqConfId + + '&back_to_url=http://localhost:8080/', ); } }, @@ -39,7 +42,7 @@ export default { window.location.replace( this.createLogoutUrl({ redirectUri: `${location.origin}/${this.$config.basePath}`, - }) + }), ); } }, diff --git a/docker/keycloak/config/keycloak_import.json b/docker/keycloak/config/keycloak_import.json index 1432552d..0b454874 100644 --- a/docker/keycloak/config/keycloak_import.json +++ b/docker/keycloak/config/keycloak_import.json @@ -1101,7 +1101,7 @@ "config": { "validateSignature": "true", "clientId": "keycloak", - "forwardParameters": "pres_req_conf_id", + "forwardParameters": "pres_req_conf_id,back_to_url", "tokenUrl": "http://controller:5000/token", "authorizationUrl": "http://localhost:5000/authorize", "clientAuthMethod": "client_secret_basic", diff --git a/oidc-controller/api/templates/verified_credentials.html b/oidc-controller/api/templates/verified_credentials.html index 57049b99..cc26baae 100644 --- a/oidc-controller/api/templates/verified_credentials.html +++ b/oidc-controller/api/templates/verified_credentials.html @@ -89,6 +89,16 @@ border-color: var(--bc-primary); color: var(--bc-primary); } + .back-btn { + display: block; + margin-bottom: 1em; + font-weight: bold; + text-decoration: none; + } + .desktop-head .back-btn { + margin-left: -350px; + } + /* BC Gov Styles */ .btn { --bs-btn-hover-bg: var(--bc-secondary); @@ -163,17 +173,24 @@ v-on:click="bcIdClicks++" /> -
-

Scan with a Digital Wallet

+
+ 🡸 Go back + +

Scan with a Digital Wallet

+
-

- Continue with: -

+
+ 🡸 Go back + +

Continue with:

+
class="btn btn-primary mt-4" v-on:click="socket.disconnect()" title="Disconnect Websocket" - >DEBUG Disconnect Web Socket + > + DEBUG Disconnect Web Socket +

@@ -449,6 +468,12 @@
socket: null, }; }, + computed: { + backToUrl() { + const urlParams = new URLSearchParams(window.location.search); + return urlParams.get("back_to_url"); + }, + }, methods: { deepLinkOpen() { this.setUiStates("pending");