Custom Database User Profile Not Updating on Login
This article explains why a custom database user profile may not update upon login for some users when using a login script designed to set user_metadata values. Other symptoms include the last_login and login_count properties not updating, even after a successful login session.
- Connections
- Custom Database
- Login
This issue occurs when multiple users share the same user_id. Although user IDs must be unique, with custom databases, it is possible to create multiple users with the same ID, as described in Updating Users with Duplicate User IDs. The system is unable to determine which user profile to update, causing the login script changes to fail.
If multiple users share the same user_id, one of two actions can be taken.
- To maintain both user profiles, follow the process outlined in the article Updating Users with Duplicate User IDs to assign a new, unique
user_idto one of the profiles. - If one of the profiles was created accidentally or is no longer needed, delete the extraneous user.
-
- Ensure the email addresses for the duplicate profiles are unique.
- Use the Delete a connection user endpoint to delete the specified user from the connection.