Skip to content

Commit 2ddfb59

Browse files
committed
removed hardcoded did
1 parent cd7654f commit 2ddfb59

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

src/popup/router/pages/Account.vue

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import QrIcon from '../../../icons/qr-code-white.svg?vue-component';
4949
import AccountInfo from '../components/AccountInfo';
5050
import BoxButton from '../components/BoxButton';
5151
import axios from 'axios';
52-
import { HYPERSIGN_AUTH_SERVER_DID } from '../../utils/hsConstants';
52+
import { HS_AUTH_DID_URL } from '../../utils/hsConstants';
5353
5454
export default {
5555
name: 'Account',
@@ -70,6 +70,7 @@ export default {
7070
credentialUrl: '',
7171
loading: false,
7272
verifiableCredential: {},
73+
hsAuthDid: ""
7374
};
7475
},
7576
computed: {
@@ -85,6 +86,14 @@ export default {
8586
console.log(JSONData)
8687
this.receiveOrGiveCredential(JSONData);
8788
}
89+
90+
91+
axios.get(HS_AUTH_DID_URL).then(res => {
92+
console.log(res)
93+
if(res && res.data){
94+
this.hsAuthDid = res.data.message
95+
}
96+
})
8897
8998
},
9099
methods: {
@@ -181,7 +190,6 @@ export default {
181190
const { appDid, schemaId } = qrData;
182191
183192
if (!schemaId) throw new Error('Invalid schemaId');
184-
if (!HYPERSIGN_AUTH_SERVER_DID) throw new Error('Hypersign Auth Server did is not set ') // this check can go at startign of the app and not here.... bad way
185193
186194
this.$store.commit('addRequestingAppInfo', qrData);
187195
this.verifiableCredential = this.hypersign.credentials.find((x) => {
@@ -192,16 +200,11 @@ export default {
192200
schemaId
193201
})
194202
if (credentialSchemaId === schemaId){
195-
console.log({
196-
issuer: x.issuer,
197-
appDid: appDid,
198-
HYPERSIGN_AUTH_SERVER_DID: HYPERSIGN_AUTH_SERVER_DID
199-
})
200203
if (x.issuer === appDid ){ // check if the app company issued this credential ;; the registration flow
201204
return x;
202205
}
203206
204-
if(x.issuer === HYPERSIGN_AUTH_SERVER_DID){ // of the issuer is Hypersign Auth server? ;; without registration flow
207+
if(x.issuer === this.hsAuthDid){ // of the issuer is Hypersign Auth server? ;; without registration flow
205208
return x;
206209
}
207210
}

src/popup/utils/hsConstants.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export const HS_NODE_BASE_URL = "https://ssi.hypermine.in/core/";
22
export const SUPERHERO_HS_AUTH_BASE_URL = "https://ssi.hypermine.in/hsauth/"; // change supero to hypersign later
33
export const SUPERHERO_HS_AUTH_CREDENTIAL_ISSUE_API = "hs/api/v2/register"; // change supero to hypersign later
4-
export const HYPERSIGN_AUTH_SERVER_DID = "did:hs:6c79a306-742a-4f80-bc66-128102f4cfe5"
5-
4+
export const HS_AUTH_DID_URL = SUPERHERO_HS_AUTH_BASE_URL + "hs/api/v2/authdid"
5+

0 commit comments

Comments
 (0)