schibsted / account-sdk-browser

Schibsted Account SDK for browsers
https://schibsted.github.io/account-sdk-browser/
MIT License
16 stars 11 forks source link

getUser returns user is not connected to merchant only base on user.result #111

Closed marjuszkiewicz closed 5 years ago

marjuszkiewicz commented 5 years ago

https://github.com/schibsted/account-sdk-browser/blob/master/src/identity.js#L544 Probably it should be user.userId && !user.result

olekenneth commented 5 years ago

It should be user.userId && user.clientAgreementAccepted && user.defaultAgreementAccepted

olekenneth commented 5 years ago

And also this should be handled in the same when calling the hasSession() not just the getUser()

marjuszkiewicz commented 5 years ago

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.

marjuszkiewicz commented 5 years ago

I did some investigation, backend returns result: false and LoginException if user haven't accept client agreement. So closing that issue