Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async getRelyingParty(identityProvider) {
// Try to load an existing relying party
let relyingParty;
const providerSettings = this._identityManager.getProviderSettings(identityProvider);
if (providerSettings) {
relyingParty = RelyingParty.from(providerSettings);
}
// Create a new relying party
else {
relyingParty = await this.registerRelyingParty(identityProvider);
this._identityManager.addProviderSettings(relyingParty);
}
return relyingParty;
}
async function getStoredRp(storage: AsyncStorage): Promise {
const data = await getData(storage)
const { rpConfig } = data
if (rpConfig) {
rpConfig.store = storage
return RelyingParty.from(rpConfig)
} else {
return null
}
}