Skip to content

User roles are not assigned when migrating users with bulk import + isVerified field is ignored. #1136

Closed
@bizon91

Description

@bizon91

🐛 Bug Report

When attempting to migrate users using /bulk-import/import, the roles specified in the userRoles field are ignored. Additionally, even when isVerified is set to false, the response shows the verified field as true

  • Issue 1: The roles defined in the userRoles field are ignored during migration via /bulk-import/import.
  • Issue 2: The isVerified field is set to false in the request, but the response returns verified: true.

Example request:

curl --location --request POST '<supertokens_core_endpoint>/bulk-import/import' \   
     --header 'api-key: *******************' \
     --header 'Content-Type: application/json; charset=utf-8' \
     --data '
    {
      "externalUserId": "test-external-id",
      "userMetadata": {       
        "deviceId": "test-device-id"
      },
      "userRoles": [{ "role": "user", "tenantIds": [] }],
      "loginMethods": [
        {
          "isVerified": false,
          "timeJoinedInMSSinceEpoch": 1551367594480,
          "recipeId": "emailpassword",
          "email": "[email protected]",
          "passwordHash": <password_hash>,
          "hashingAlgorithm": "bcrypt"
        }
      ]
    }
'   

Response:

{"status":"OK","user":{"id":"test-external-id","isPrimaryUser":false,"tenantIds":["public"],"timeJoined":1551367594480,"emails":["[email protected]"],"phoneNumbers":[],"thirdParty":[],"webauthn":{"credentialIds":[]},"loginMethods":[{"tenantIds":["public"],"recipeUserId":"test-external-id","verified":true,"timeJoined":1551367594480,"recipeId":"emailpassword","email":"[email protected]"}]}}

Useful informations

I'm using latest supertokens-docker-mysql image. I don't use multi-tenancy. Role user is already defined.

Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions