Hi, this is Yasin.
This is for social login providers. I am trying to set the
user metadata and read it after setting it, in a single post login action file. However, I get an error.
user metadata cannot set on Step 5 or the newly set
user metadata cannot be read in Step 6 because I get an error
This is a fundamental issue and I have to solve it as quickly as possible.
Thank you so much!
Code flow is like this:
Check if the attempt is a social login.
If true, check if there is a certain key/value pair in metadata by
If there is no metadata, it could be
null, etc. This means that I have not created this user also on my external database.
Hence, run a method that creates the user on external db (Hasura, in this case). Return the created user object. (This step works successfully. I am very grateful that Auth0 allows such an operation by the way.)
Using this user object, set user metadata as following:
Now, get the newly set
event.user.user_metadata.hasuraUserattribute, then set custom claims for tokens.
_claimproperty just uses the
- Finish Post Login action.