Has anyone ever try the JS API 4.18 oauth sample at
https://developers.arcgis.com/javascript/latest/sample-code/identity-oauth-basic/
(save to a local file and run it on localhost or a Dev server) and then find that after signed in (with an AGOL for Organization paid user account) you get a portal.user is null error (from the web console) so that the app breaks on trying to get portal.user.username?
When that happens, if you try to load your own secure layer (additional code) it will get a permission error and will not load, even though the credential exists in the Session Storage.
Why would the Identity Manager grant the login but Portal loads with a portal.user null result? What good is the credential returned by the checkSignedInStatus() if you still cannot access your own services?