mirror of
https://github.com/selfxyz/self.git
synced 2026-04-27 03:01:15 -04:00
Merge pull request #405 from selfxyz/hotfix/stuck-on-splash-screen
feat: improve tree and registration
This commit is contained in:
@@ -201,6 +201,9 @@ export async function isUserRegistered(
|
||||
passportData: PassportData,
|
||||
secret: string,
|
||||
) {
|
||||
if (!passportData) {
|
||||
return false;
|
||||
}
|
||||
const commitment = generateCommitment(
|
||||
secret,
|
||||
PASSPORT_ATTESTATION_ID,
|
||||
|
||||
@@ -14,6 +14,7 @@ export const DSC_TREE_URL = 'https://tree.self.xyz/dsc';
|
||||
export const CSCA_TREE_URL_STAGING = 'https://tree.staging.self.xyz/csca';
|
||||
export const DSC_TREE_URL_STAGING = 'https://tree.staging.self.xyz/dsc';
|
||||
export const IDENTITY_TREE_URL = 'https://tree.self.xyz/identity';
|
||||
export const IDENTITY_TREE_URL_STAGING = 'https://tree.staging.self.xyz/identity';
|
||||
|
||||
export const PASSPORT_ATTESTATION_ID = '1'; //"8518753152044246090169372947057357973469996808638122125210848696986717482788"
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ export async function getDSCTree(endpointType: EndpointType): Promise<string> {
|
||||
}
|
||||
|
||||
export async function getCommitmentTree(documentType: DocumentType | null): Promise<string> {
|
||||
const identityTreeUrl = documentType === null || documentType === 'passport' ? IDENTITY_TREE_URL : IDENTITY_TREE_URL_STAGING;
|
||||
const identityTreeUrl = !documentType || typeof documentType !== 'string' || documentType === 'passport' ? IDENTITY_TREE_URL : IDENTITY_TREE_URL_STAGING;
|
||||
const response = await fetch(identityTreeUrl);
|
||||
return await response.json().then(data => data.data ? data.data : data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user