-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error updating user attributes #238
Comments
Inspecting the source I found that the correct code might by: let user = await Auth.currentAuthenticatedUser();
let result = await Auth.updateUserAttributes(user, {
'foo': 'bar'
}); It seems that just the docs need an update. |
By inspecting the source, I realized something and wanted to to point it out in case others would need it. Currently, the docs says that you can retrieve userAttributes like this:
But this doesn't return the User Attributes directly. You then need to make another call like this:
|
How to update custom attribute @vipseixas ? |
@navjotdhanawat I had the same issues with the 0.3.4, installing the latest version fix the problem for me |
I'm currently getting the error
after trying
It seems to be because the |
Sorry for the late response... I'm using this code with Amplify 0.3.3: let user = await Auth.currentAuthenticatedUser();
await Auth.currentCredentials(); // See https://github.com/aws/aws-amplify/issues/592
let params = {};
params['custom:' + name] = value;
let result = await Auth.updateUserAttributes(user, params); |
@vipseixas what's the point of doing Do you mind sharing the |
I am getting Session: null when calling var user = await Auth.currentAuthenticatedUser(); that;s the reason for the error on currentCredentials() ... any ideas ? |
@j0b0sapi3n There was a bug that prevented Auth.currentAuthenticatedUser() to fill the user credentias and that's why I used the Auth.currentCredentials() to force the credentials to be loaded inside the user object. I think that this is not the case anymore at newer versions. |
Session: null TypeError: user.getSession is not a function It seems to be because the Session value in the CognitoUser object that is returned from currentAuthenticatedUser() is null Please help me to fix this.. |
I just had similar issue and it turned out that I had old version 0.3.0. After updating aws-amplify to 1.0.5 "updateUserAttributes" started working again. |
@vipseixas @mevert Can you share your current working code for updateUserAttributes? I have tried various solutions offered here and it's not working yet. |
Hi @NL33, the code I used is in #238 (comment), but I haven't been working on this project for a long time and I don't know if something has changed. |
Thanks, @vipseixas. My biggest issue has been finding the right documentation. After a lot of searching, I still have not found an actual code example from AWS on the right way to update user attributes. This link has some guidance, but not an actual example. |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
I am following the docs:
And getting this error:
TypeError: user.getSession is not a function
. Indeed the object returned from Auth.currentUserInfo() does not have a getSession() function.I am using aws-amplify version 0.2.2.
The text was updated successfully, but these errors were encountered: