I’m trying to link an account with a post login trigger automatically where I check the existing user with email and link users who have an existing identity. The linking works as expected but when I call api.authentication.setPrimaryUser
I get an error saying Organizations is not supported together with primary user modifications
, I guess this is because we have enabled auto-registration in one of our organizations.
Reference flow:
- Existing user via database connection belongs to ABC organisation
- New user = with same email via google connection now belongs to both ABC + Org1 (auto-membership organisation)
- Action linking works but returns an error of
Organizations is not supported together with primary user modifications
when login flow is completed hence, login fails at the end. - It does work as intended on the second login