fix issue with localstorage of codeverifier

make sure we update the connected list when connection successful.
This commit is contained in:
Jason Kulatunga 2022-10-03 21:40:35 -07:00
parent f03bdbd122
commit 81151c0318
2 changed files with 5 additions and 1 deletions

View File

@ -175,6 +175,10 @@ export class MedicalSourcesComponent implements OnInit {
// window.location.reload();
console.log("source credential create response:", respData)
//remove item from available sources list, add to connected sources.
this.availableSourceList.splice(this.availableSourceList.indexOf(this.metadataSources[sourceType]), 1);
this.connectedSourceList.push({source: respData, metadata: this.metadataSources[sourceType]})
},
(err) => {
delete this.status[sourceType]

View File

@ -50,7 +50,7 @@ export class LighthouseService {
const codeChallenge = await Oauth.calculatePKCECodeChallenge(codeVerifier);
const codeChallengeMethod = lighthouseSource.code_challenge_methods_supported[0]; // 'S256'
localStorage.setItem(`${lighthouseSource}:code_verifier`, codeVerifier)
localStorage.setItem(`${sourceType}:code_verifier`, codeVerifier)
localStorage.setItem(`${sourceType}:code_challenge`, codeChallenge)
localStorage.setItem(`${sourceType}:code_challenge_method`, codeChallengeMethod)