Closed marjuszkiewicz closed 5 years ago
It should be user.userId && user.clientAgreementAccepted && user.defaultAgreementAccepted
And also this should be handled in the same when calling the hasSession()
not just the getUser()
Thank you for your comment @olekenneth , user.clientAgreementAccepted && user.defaultAgreementAccepted
are returned only for logged in and connected user. If result is false
, as in this example https://github.com/schibsted/account-sdk-browser/blob/master/src/identity.js#L544 they are not present.
I did some investigation, backend returns result: false
and LoginException if user haven't accept client agreement. So closing that issue
https://github.com/schibsted/account-sdk-browser/blob/master/src/identity.js#L544 Probably it should be
user.userId && !user.result