From b643f54e9ad1639f1b2a6d03334f3d8f141bec26 Mon Sep 17 00:00:00 2001 From: Ashish Tiwari Date: Wed, 7 Jul 2021 11:30:13 +0530 Subject: [PATCH 01/37] just checking, Closing window automatic after authorize --- src/popup/router/pages/CredentialsDetailsAuthorize.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/popup/router/pages/CredentialsDetailsAuthorize.vue b/src/popup/router/pages/CredentialsDetailsAuthorize.vue index 36581bb62..a8f61e0db 100644 --- a/src/popup/router/pages/CredentialsDetailsAuthorize.vue +++ b/src/popup/router/pages/CredentialsDetailsAuthorize.vue @@ -112,6 +112,7 @@ export default { throw new Error('Could not authorize the user') }else if(response.status == 200){ if (response.message) + window.close(); await this.$store.dispatch('modals/open', { name: 'default', msg: 'Credential successfully verified', From a6722d4a75165de459a96157a9150f5c063065b2 Mon Sep 17 00:00:00 2001 From: Ashish Tiwari Date: Wed, 7 Jul 2021 11:35:06 +0530 Subject: [PATCH 02/37] Added console logs to verify deploy --- src/popup/router/pages/CredentialsDetailsAuthorize.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/popup/router/pages/CredentialsDetailsAuthorize.vue b/src/popup/router/pages/CredentialsDetailsAuthorize.vue index a8f61e0db..e21d6b8c8 100644 --- a/src/popup/router/pages/CredentialsDetailsAuthorize.vue +++ b/src/popup/router/pages/CredentialsDetailsAuthorize.vue @@ -111,8 +111,10 @@ export default { if(response.status == 401 || response.status == 403) { throw new Error('Could not authorize the user') }else if(response.status == 200){ + + console.log("RESPONSE 200, successfull") + window.close(); if (response.message) - window.close(); await this.$store.dispatch('modals/open', { name: 'default', msg: 'Credential successfully verified', From 96e0aa3ae994a9a2c2aa7b27f253a36d67afdefe Mon Sep 17 00:00:00 2001 From: Ashish Tiwari Date: Wed, 7 Jul 2021 11:39:23 +0530 Subject: [PATCH 03/37] close after 10 seconds --- src/popup/router/pages/CredentialsDetailsAuthorize.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/popup/router/pages/CredentialsDetailsAuthorize.vue b/src/popup/router/pages/CredentialsDetailsAuthorize.vue index e21d6b8c8..84cec76ef 100644 --- a/src/popup/router/pages/CredentialsDetailsAuthorize.vue +++ b/src/popup/router/pages/CredentialsDetailsAuthorize.vue @@ -113,6 +113,10 @@ export default { }else if(response.status == 200){ console.log("RESPONSE 200, successfull") + consol.log(response.message); + setTimeout(() => { + window.close(); + }, 10000) window.close(); if (response.message) await this.$store.dispatch('modals/open', { From a9bca99116c0572d2977c5e8ae7ebe8e59ca9f0a Mon Sep 17 00:00:00 2001 From: Ashish Tiwari Date: Wed, 7 Jul 2021 12:12:05 +0530 Subject: [PATCH 04/37] trying to log response message on authorization --- src/popup/router/pages/CredentialsDetailsAuthorize.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/popup/router/pages/CredentialsDetailsAuthorize.vue b/src/popup/router/pages/CredentialsDetailsAuthorize.vue index 84cec76ef..583521faa 100644 --- a/src/popup/router/pages/CredentialsDetailsAuthorize.vue +++ b/src/popup/router/pages/CredentialsDetailsAuthorize.vue @@ -113,7 +113,7 @@ export default { }else if(response.status == 200){ console.log("RESPONSE 200, successfull") - consol.log(response.message); + console.log(response.message); setTimeout(() => { window.close(); }, 10000) From b979ce62a795b17882546800e095e1d6928ea815 Mon Sep 17 00:00:00 2001 From: Ashish Tiwari Date: Wed, 7 Jul 2021 12:50:21 +0530 Subject: [PATCH 05/37] Adding localStorage to check mobile/web wallet --- .../pages/CredentialsDetailsAuthorize.vue | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/popup/router/pages/CredentialsDetailsAuthorize.vue b/src/popup/router/pages/CredentialsDetailsAuthorize.vue index 583521faa..c71d8a735 100644 --- a/src/popup/router/pages/CredentialsDetailsAuthorize.vue +++ b/src/popup/router/pages/CredentialsDetailsAuthorize.vue @@ -111,19 +111,16 @@ export default { if(response.status == 401 || response.status == 403) { throw new Error('Could not authorize the user') }else if(response.status == 200){ - - console.log("RESPONSE 200, successfull") - console.log(response.message); - setTimeout(() => { - window.close(); - }, 10000) - window.close(); - if (response.message) - await this.$store.dispatch('modals/open', { + if (response.message){ + window.close() + await this.$store.dispatch('modals/open', { name: 'default', msg: 'Credential successfully verified', }); - this.reject() + this.reject() + } + + }else { throw new Error(response.error) } From 5b7c604f75c09321733e78ca227127e419185877 Mon Sep 17 00:00:00 2001 From: Ashish Tiwari Date: Wed, 7 Jul 2021 12:50:47 +0530 Subject: [PATCH 06/37] Adding localStorage to check mobile/web wallet --- src/popup/router/pages/Account.vue | 3 +++ src/popup/router/pages/CredentialsDetailsAuthorize.vue | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/popup/router/pages/Account.vue b/src/popup/router/pages/Account.vue index f95c6abc3..e4b795ec0 100644 --- a/src/popup/router/pages/Account.vue +++ b/src/popup/router/pages/Account.vue @@ -80,6 +80,7 @@ export default { }, async created() { try { + // put it somewhere eles other whise it wont work... like somewhere when the app loads if (!this.hypersign.hsAuthDID) { const res = await axios.get(HS_AUTH_DID_URL); @@ -94,6 +95,7 @@ export default { } else { this.hsAuthDid = this.hypersign.hsAuthDID; } + localStorage.setItem("isMobileWallet", false) //Only for deeplinking if (this.$route.query.url && this.$route.query.url != '') { @@ -106,6 +108,7 @@ export default { }, methods: { async scan() { + localStorage.setItem("isMobileWallet", true) const QRData = await this.$store.dispatch('modals/open', { name: 'read-qr-code', title: this.$t('pages.credential.scan'), diff --git a/src/popup/router/pages/CredentialsDetailsAuthorize.vue b/src/popup/router/pages/CredentialsDetailsAuthorize.vue index c71d8a735..1de92df7e 100644 --- a/src/popup/router/pages/CredentialsDetailsAuthorize.vue +++ b/src/popup/router/pages/CredentialsDetailsAuthorize.vue @@ -111,6 +111,8 @@ export default { if(response.status == 401 || response.status == 403) { throw new Error('Could not authorize the user') }else if(response.status == 200){ + + console.log("IS MOBILE WALLET", localStorage.getItem("isMobileWallet")) if (response.message){ window.close() await this.$store.dispatch('modals/open', { From aeba73622099896a0e5f6697891164c879c42212 Mon Sep 17 00:00:00 2001 From: Ashish Tiwari Date: Wed, 7 Jul 2021 13:01:56 +0530 Subject: [PATCH 07/37] Adding localStorage to check mobile/web wallet --- src/popup/router/pages/CredentialsDetailsAuthorize.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/popup/router/pages/CredentialsDetailsAuthorize.vue b/src/popup/router/pages/CredentialsDetailsAuthorize.vue index 1de92df7e..29a1bfa6c 100644 --- a/src/popup/router/pages/CredentialsDetailsAuthorize.vue +++ b/src/popup/router/pages/CredentialsDetailsAuthorize.vue @@ -114,7 +114,7 @@ export default { console.log("IS MOBILE WALLET", localStorage.getItem("isMobileWallet")) if (response.message){ - window.close() + // window.close() await this.$store.dispatch('modals/open', { name: 'default', msg: 'Credential successfully verified', From 7c40574107857b1cfd6b3af6964328457b910206 Mon Sep 17 00:00:00 2001 From: Ashish Tiwari Date: Wed, 7 Jul 2021 13:11:30 +0530 Subject: [PATCH 08/37] Only closing popup for web wallet --- src/popup/router/pages/CredentialsDetailsAuthorize.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/popup/router/pages/CredentialsDetailsAuthorize.vue b/src/popup/router/pages/CredentialsDetailsAuthorize.vue index 29a1bfa6c..fe04b854d 100644 --- a/src/popup/router/pages/CredentialsDetailsAuthorize.vue +++ b/src/popup/router/pages/CredentialsDetailsAuthorize.vue @@ -112,9 +112,13 @@ export default { throw new Error('Could not authorize the user') }else if(response.status == 200){ - console.log("IS MOBILE WALLET", localStorage.getItem("isMobileWallet")) + const isMobileWallet = JSON.parse(localStorage.getItem("isMobileWallet")); if (response.message){ - // window.close() + + if(!isMobileWallet){ + window.close() + } + await this.$store.dispatch('modals/open', { name: 'default', msg: 'Credential successfully verified', From 261ede269546ffc03a1e9728fe215edfa7bc7d0e Mon Sep 17 00:00:00 2001 From: Ashish Tiwari Date: Wed, 7 Jul 2021 13:11:40 +0530 Subject: [PATCH 09/37] Only closing popup for web wallet --- src/popup/router/pages/CredentialsDetailsAuthorize.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/popup/router/pages/CredentialsDetailsAuthorize.vue b/src/popup/router/pages/CredentialsDetailsAuthorize.vue index fe04b854d..35bfae5eb 100644 --- a/src/popup/router/pages/CredentialsDetailsAuthorize.vue +++ b/src/popup/router/pages/CredentialsDetailsAuthorize.vue @@ -116,7 +116,7 @@ export default { if (response.message){ if(!isMobileWallet){ - window.close() + return window.close() } await this.$store.dispatch('modals/open', { From d0adaee9c23c53da7316a33897264865336f0dc9 Mon Sep 17 00:00:00 2001 From: Ashish Tiwari Date: Wed, 28 Jul 2021 06:15:31 -0400 Subject: [PATCH 10/37] authnticating google in same window --- src/popup/router/pages/Index.vue | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/popup/router/pages/Index.vue b/src/popup/router/pages/Index.vue index 4b1f80237..eb0b61f78 100644 --- a/src/popup/router/pages/Index.vue +++ b/src/popup/router/pages/Index.vue @@ -66,6 +66,16 @@ import registration from '../../../mixins/registration'; import HypersignSsiSDK from 'hs-ssi-sdk'; import { HS_NODE_BASE_URL } from '../../utils/hsConstants' import auth0 from "auth0-js"; + + const newWebAuth = new auth0.WebAuth({ + domain: "fidato.us.auth0.com", + clientID: "hwM9GmM4nUstds9Fw5KsYZVDboJBeLTL", + responseType: "token id_token", + scope: "openid profile email", + + }) + + export default { mixins: [registration], components: { Logo,Input, SuperheroLogo, CheckBox, Button, Platforms }, @@ -78,27 +88,11 @@ export default { methods: { loginWithGoogle(){ - const newWebAuth = new auth0.WebAuth({ - domain: "fidato.us.auth0.com", - clientID: "hwM9GmM4nUstds9Fw5KsYZVDboJBeLTL", - responseType: "token id_token", - scope: "openid profile email", - // redirectUri: window.location.origin + "/app/admin/login", - }) - - newWebAuth.popup.authorize( + newWebAuth.authorize( { connection: "google-oauth2", - owp: true - }, - function (err, authRes) { - console.log(authRes, err) - if(!err){ - newWebAuth.client.userInfo(authRes.accessToken, function(err, user) { - console.log(err, user) - }) - } - + redirectUri: "http://localhost:4999/chrome/popup/popup#/", + }); }, gotoRestore(){ From 241552531763d997be124b4ff64a4899b2e559e8 Mon Sep 17 00:00:00 2001 From: Ashish Tiwari Date: Wed, 28 Jul 2021 07:13:33 -0400 Subject: [PATCH 11/37] added new Auth file --- src/popup/router/pages/Auth.vue | 20 ++++++++++++++++++++ src/popup/router/pages/Index.vue | 4 ++-- src/popup/router/routes/index.js | 10 ++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 src/popup/router/pages/Auth.vue diff --git a/src/popup/router/pages/Auth.vue b/src/popup/router/pages/Auth.vue new file mode 100644 index 000000000..eff2d91ac --- /dev/null +++ b/src/popup/router/pages/Auth.vue @@ -0,0 +1,20 @@ + + + + + diff --git a/src/popup/router/pages/Index.vue b/src/popup/router/pages/Index.vue index eb0b61f78..9daf6cc96 100644 --- a/src/popup/router/pages/Index.vue +++ b/src/popup/router/pages/Index.vue @@ -91,8 +91,8 @@ export default { newWebAuth.authorize( { connection: "google-oauth2", - redirectUri: "http://localhost:4999/chrome/popup/popup#/", - + redirectUri: "http://localhost:4999/auth/gauth?" + }); }, gotoRestore(){ diff --git a/src/popup/router/routes/index.js b/src/popup/router/routes/index.js index db5e253aa..b987c3d60 100644 --- a/src/popup/router/routes/index.js +++ b/src/popup/router/routes/index.js @@ -22,6 +22,7 @@ import CredentialsDetails from '../pages/CredentialsDetails'; import CredentialsDetailsTemp from '../pages/CredentialsDetailsTemp'; import CredentialsDetailsAuthorize from '../pages/CredentialsDetailsAuthorize'; import Deeplink from '../pages/Deeplink'; +import Auth from "../pages/Auth"; export default [{ path: '/', @@ -37,7 +38,15 @@ export default [{ path: '/account', name: 'account', component: Account, + }, + + { + path: "/auth/:authType", + name: "auth", + exactPath: true, + component: Auth, }, + { path: '/deeplink', name: 'deeplink', @@ -180,6 +189,7 @@ export default [{ title: 'credentialDetailsTemp' } }, + { name: 'CredentialsDetailsAuthorize', path: '/credential/authorize/:credentialId', From 7ef1b730af746ae6422c5613fc2b91c531a1343c Mon Sep 17 00:00:00 2001 From: vishwas anand Date: Wed, 28 Jul 2021 23:39:26 +0530 Subject: [PATCH 12/37] integrated with backend ofor google auth --- package-lock.json | 2 +- src/mixins/registration.js | 30 +++++++++++++--- src/popup/router/pages/Account.vue | 36 +++++++++++++------ src/popup/router/pages/Index.vue | 56 +++++++++++++++++++++++++----- src/popup/utils/hsConstants.js | 4 +-- 5 files changed, 102 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd260bdd8..b448f7279 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,7 @@ "requires": true, "dependencies": { "@aeternity/aepp-components": { - "version": "git+https://github.com/aeternity/aepp-components.git#4f7384f754df464a4b83745255cdaded16ad18fb", + "version": "git+https://github.com/aeternity/aepp-components.git#dedf56a5bd08465846b06945cf05a6a65fb94212", "from": "git+https://github.com/aeternity/aepp-components.git#develop", "requires": { "@download/blockies": "^1.0.3", diff --git a/src/mixins/registration.js b/src/mixins/registration.js index e784f5fde..3a1da9cc2 100644 --- a/src/mixins/registration.js +++ b/src/mixins/registration.js @@ -41,7 +41,7 @@ export default { this.ifEdit = false; this.ifCreate = true; }, - async setupProfile() { + async setupProfile(isThridPartyAuth = false) { // try { // this.loading = true; //// HS_TODO:: @@ -52,22 +52,44 @@ export default { const HS_STUDIO_REGISTER_URL = `${SUPERHERO_HS_AUTH_BASE_URL}${SUPERHERO_HS_AUTH_CREDENTIAL_ISSUE_API}` const body = { - name: this.profile.name, - email: this.profile.email + user: { + name: this.profile.name, + email: this.profile.email + }, + isThridPartyAuth: false } + if(isThridPartyAuth){ + body["user"]["did"] = this.profile.did; + body["isThridPartyAuth"] = true; + } + + // console.log("Calling authserver register") + let res = await axios.post(HS_STUDIO_REGISTER_URL, body); if (!res) throw new Error("Could not register the user"); + // console.log("After getting response") res = res.data; + // console.log(res) + // console.log(res.message) if (res && res.status != 200) throw new Error(res.error); + + + // console.log(typeof(res.message)) + // console.log(res.message) + if(isThridPartyAuth && res && res.message){ + // console.log("Before setting 3rdPartyAuthVC"); + // only in case of 3rd party auth, verifiable credenital will come + localStorage.setItem("3rdPartyAuthVC", JSON.stringify(res.message)); + } this.$store.commit('addHSProfile', this.profile); this.ifEdit = true; this.ifCreate = false; this.ifAllDisabled = true; - return true; + return true; }, }, }; \ No newline at end of file diff --git a/src/popup/router/pages/Account.vue b/src/popup/router/pages/Account.vue index e4b795ec0..9d6325caa 100644 --- a/src/popup/router/pages/Account.vue +++ b/src/popup/router/pages/Account.vue @@ -102,6 +102,19 @@ export default { const JSONData = decodeURI(this.$route.query.url); this.receiveOrGiveCredential(JSONData); } + + + const vcStr = localStorage.getItem("3rdPartyAuthVC"); + if(vcStr){ + // console.log("vcStr is present"); + const vc = JSON.parse(vcStr); + // console.log("Able to parse vcStr") + if(vc){ + // console.log("Vc is not null"); + // console.log("Calling credentialsQRData()"); + this.credentialsQRData(vc); + } + } } catch (e) { if (e.message) this.$store.dispatch('modals/open', { name: 'default', msg: e.message }); } @@ -125,7 +138,9 @@ export default { // console.log(data); switch(data.QRType){ case 'ISSUE_CRED': { - this.credentialsQRData(data.url); + this.credentialUrl = data.url; + let cred = await this.fetchCredential(); + this.credentialsQRData(cred); break; } case 'REQUEST_CRED': { @@ -144,6 +159,9 @@ export default { }, async fetchCredential() { + if(!this.credentialUrl){ + throw new Error("Credential Url is null or empty"); + } this.credentialUrl = this.credentialUrl + '&did=' + this.hypersign.did; this.loading = true; let response = await axios.get(this.credentialUrl); @@ -157,19 +175,18 @@ export default { return response.message; }, - async credentialsQRData(data) { + async credentialsQRData(cred) { try { - this.credentialUrl = data; - let cred = await this.fetchCredential(); - + if(!cred){ + throw new Error('Credential can not be null or empty'); + } // TODO: Check if this credential already exsits in wallet: otherwise reject const credInWallet = this.hypersign.credentials.find((x) => x.id == cred.id); if (credInWallet) { throw new Error('The credential already exist in your wallet'); } - // console.log(1) - + // console.log({ // hs_app_did: this.hypersign.did, // credentialSubjectDid: cred.credentialSubject.id @@ -178,12 +195,11 @@ export default { // TODO: Check if you are the owner of this credenital: otherwise reject if (this.hypersign.did != cred.credentialSubject.id) { throw new Error('The credential is not issued to you'); - } - - // console.log(2) + } this.$store.commit('addHSVerifiableCredentialTemp', cred); this.$router.push(`/credential/temp/${cred.id}`); + localStorage.removeItem("3rdPartyAuthVC"); } catch (e) { console.log(e); this.loading = false; diff --git a/src/popup/router/pages/Index.vue b/src/popup/router/pages/Index.vue index 9daf6cc96..4b0149469 100644 --- a/src/popup/router/pages/Index.vue +++ b/src/popup/router/pages/Index.vue @@ -83,17 +83,50 @@ export default { termsAgreed: false, IS_WEB: process.env.PLATFORM === 'web', IN_FRAME, - loading: false + loading: false, + isThridPartyAuth: false }), methods: { loginWithGoogle(){ - newWebAuth.authorize( + // newWebAuth.authorize( + // { + // connection: "google-oauth2", + // redirectUri: "http://localhost:4999/auth/gauth?" + + // }); + + // need to remove this hardcoding.... + const newWebAuth = new auth0.WebAuth({ + domain: "fidato.us.auth0.com", + clientID: "hwM9GmM4nUstds9Fw5KsYZVDboJBeLTL", + responseType: "token id_token", + scope: "openid profile email", + // redirectUri: window.location.origin + "/app/admin/login", + }) + const that = this; + newWebAuth.popup.authorize( { connection: "google-oauth2", - redirectUri: "http://localhost:4999/auth/gauth?" - + owp: true + }, + function (err, authRes) { + // console.log(authRes, err) + if(!err){ + newWebAuth.client.userInfo(authRes.accessToken, function(err, user) { + // console.log(err, user) + const { email, name } = user; + // console.log({email, name}) + that.profile.email = email; + that.profile.name = name; + that.isThridPartyAuth = true; + that.createWallet(true); + }) + } + }); + + }, gotoRestore(){ this.$router.push('restoreWallet') @@ -116,6 +149,9 @@ export default { if (e.message) this.$store.dispatch('modals/open', { name: 'default', msg:e.message }); return; } + + + const hsSdk = new HypersignSsiSDK({ nodeUrl: HS_NODE_BASE_URL }); this.mnemonic = generateMnemonic(); @@ -180,16 +216,18 @@ export default { // this.$store.commit('switchLoggedIn', true); // this.$store.commit('updateAccount', keypair); // this.$store.commit('setActiveAccount', { publicKey: keypair.publicKey, index: 0 }); - console.log("Before setting profile") - if(await this.setupProfile()){ + // console.log("Before setting profile") + if(await this.setupProfile(this.isThridPartyAuth)){ console.log("After setting profile"); console.log("Calling setLogin") await this.$store.dispatch('setLogin', { keypair }); this.$store.commit('switchLoggedIn', true); - const msg = 'An email with a QR code has been sent to the address you provided.\ - Scan the QR code to receieve the credential' - this.$store.dispatch('modals/open', { name: 'default', msg }); + if(!this.isThridPartyAuth){ + const msg = 'An email with a QR code has been sent to the address you provided.\ + Scan the QR code to receieve the credential' + this.$store.dispatch('modals/open', { name: 'default', msg }); + } Object.assign(this.profile, {}); console.log("Moving to next route") diff --git a/src/popup/utils/hsConstants.js b/src/popup/utils/hsConstants.js index 6f0f831f0..71c63ed3f 100644 --- a/src/popup/utils/hsConstants.js +++ b/src/popup/utils/hsConstants.js @@ -1,5 +1,5 @@ -export const HS_NODE_BASE_URL = "https://ssi.hypermine.in/core/"; -export const SUPERHERO_HS_AUTH_BASE_URL = "https://ssi.hypermine.in/hsauth/"; // change supero to hypersign later +export const HS_NODE_BASE_URL = "https://stage.hypermine.in/core/"; +export const SUPERHERO_HS_AUTH_BASE_URL = "https://stage.hypermine.in/hsauth/"; // change supero to hypersign later export const SUPERHERO_HS_AUTH_CREDENTIAL_ISSUE_API = "hs/api/v2/register"; // change supero to hypersign later export const HS_AUTH_DID_URL = SUPERHERO_HS_AUTH_BASE_URL + "hs/api/v2/authdid" \ No newline at end of file From 6cf4c639371d793d0e005d1781dc7b1eb49c9ece Mon Sep 17 00:00:00 2001 From: vishwas anand Date: Thu, 29 Jul 2021 11:23:35 +0530 Subject: [PATCH 13/37] at first verifiying the 3rdpartyauth --- src/popup/router/pages/Account.vue | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/popup/router/pages/Account.vue b/src/popup/router/pages/Account.vue index 9d6325caa..687df927c 100644 --- a/src/popup/router/pages/Account.vue +++ b/src/popup/router/pages/Account.vue @@ -80,6 +80,18 @@ export default { }, async created() { try { + + const vcStr = localStorage.getItem("3rdPartyAuthVC"); + if(vcStr){ + // console.log("vcStr is present"); + const vc = JSON.parse(vcStr); + // console.log("Able to parse vcStr") + if(vc){ + // console.log("Vc is not null"); + // console.log("Calling credentialsQRData()"); + this.credentialsQRData(vc); + } + } // put it somewhere eles other whise it wont work... like somewhere when the app loads if (!this.hypersign.hsAuthDID) { @@ -104,17 +116,7 @@ export default { } - const vcStr = localStorage.getItem("3rdPartyAuthVC"); - if(vcStr){ - // console.log("vcStr is present"); - const vc = JSON.parse(vcStr); - // console.log("Able to parse vcStr") - if(vc){ - // console.log("Vc is not null"); - // console.log("Calling credentialsQRData()"); - this.credentialsQRData(vc); - } - } + } catch (e) { if (e.message) this.$store.dispatch('modals/open', { name: 'default', msg: e.message }); } From 8523dbb963d7d6d3d62e09832824ff66f67e15cd Mon Sep 17 00:00:00 2001 From: Ashish Tiwari Date: Thu, 29 Jul 2021 13:03:46 +0530 Subject: [PATCH 14/37] Callback setup --- src/popup/router/pages/Auth.vue | 8 ++++++- src/popup/router/pages/Index.vue | 40 ++++++++++++++++++-------------- src/popup/router/routes/index.js | 5 ++-- 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/src/popup/router/pages/Auth.vue b/src/popup/router/pages/Auth.vue index eff2d91ac..9cf6403cb 100644 --- a/src/popup/router/pages/Auth.vue +++ b/src/popup/router/pages/Auth.vue @@ -11,8 +11,14 @@ export default { name: 'Auth', - components: {} + components: {}, + mounted(){ + console.log("HII I AM AUTH") + } + }; + +