Azure-Samples / ms-identity-ciam-javascript-tutorial

CIAM JavaScript samples
MIT License
26 stars 37 forks source link

Change getActiveAccount to be getAllAccounts #83

Open Jade-Codes opened 3 months ago

Jade-Codes commented 3 months ago

Purpose

When using the sample, I noticed a small error with the original sample. In the example there is a section that says you should set the active account by doing the following:

getActiveAccount()[0]

This wouldn't make sense since why would you be setting active account by getting the first active account if getActiveAccount() is false? I believe this is erroneous and should be getAllAccounts() based on the logic.

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type

What kind of change does this Pull Request introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:
nivethan-dev commented 1 month ago

+1

langley-enduir commented 1 week ago

Something of note... I used this sample code and everything ran perfectly when run locally and hosted via S3/CF until I changed my deployment structure to multiapp. That is when this code began to fail. I made the exact change suggested by this PR and it worked again.

So I can verify that this fix works.