question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When can AccountInfo be null after login resolves?

See original GitHub issue

Library

  • msal@1.x.x or @azure/msal@1.x.x
  • @azure/msal-browser@2.9.0
  • @azure/msal-node@1.x.x
  • @azure/msal-react@1.x.x
  • @azure/msal-angular@0.x.x
  • @azure/msal-angular@1.x.x
  • @azure/msal-angular@2.x.x
  • @azure/msal-angularjs@1.x.x

Description

I’m upgrading from 2.4.1 to 2.9.0 and I’m running into new type errors when accessing AccountInfo on the resolved value of the login APIs, example:

const ssoResult = await msal.ssoSilent(...);
console.log(ssoResult.account.username); // Object is possibly 'null'. ts(2531)

I’d like to know if there is now a potential scenario where the login api’s can resolve but not include AccountInfo data? If so, any way to avoid this scenario?

Source

  • Internal (Microsoft)
  • Customer request

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jo-arroyocommented, Jan 14, 2021

@deasems The account property is marked as null because there are scenarios in other libraries where account may not be populated, but it should always be populated when using msal-browser. We will look into improving this to make it less confusing.

1reaction
pkanher617commented, Feb 18, 2021

I will try to put out a PR that addresses this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

‎Receive "Null" at login with my U-Verse Account Info via a ...
Every time I attempt to log-in with my AT&T U-Verse account via an app on my iphone, apple tv, or directly through a...
Read more >
Corda Account: Getting Account Info From Public Key Returns ...
Hey Adel, I tried syncing the keys but its still giving null. While looking deeper into the logs I found some errors like...
Read more >
My name shows up as null null, why is this and how do I fix it?
For issue 1, the fix is to either go to your Microsoft Account page and enter the missing details or contact your Office...
Read more >
Common Issues with SAML Authentication - Blackboard Help
If an error appears after you log in on the IdP's page, the reasons could be that: ... This can be resolved by...
Read more >
Time resolved speckle contrast optical spectroscopy at quasi ...
Time resolved speckle contrast optical spectroscopy at quasi-null source-detector separation for non-invasive measurement of microvascular blood flow.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found