nhost-js-sdk icon indicating copy to clipboard operation
nhost-js-sdk copied to clipboard

onAuthStateChanged

Open joshua1 opened this issue 3 years ago • 0 comments

using the nhost-js-sdk, when auth.login is called, an object is returned on successful login containing the Session, user, and MFA properties. This should be the same object passed to the callback function as the parameter for onAuthStateChanged function (or at the very least user and session) and when the user is logged out, this object can be null, as we apply the same logic in both cases (update user details in-store and in some cases fetch user-related data). Currently, onAuthStateChange only returns a boolean value to the callback function as a parameter. It is only useful when that value is false. When Auth State changes, that State information whatever it is should be returned

joshua1 avatar Nov 09 '21 09:11 joshua1