Skip to content

Cannot add members via REST API #2195

@norairn

Description

@norairn

First of all, thank you for doing great job with Dexie Cloud!

I'm running into some issues with adding members using Dexie Cloud and the REST API. I found a resolved issue online that seemed relevant, but when I follow the steps exactly, I still get errors. Here's how I'm trying to reproduce it.

Create a new database.

npx dexie-cloud create

Obtain a token and send the following request. Using rlm-public in this experiment.

### Add members
POST {{baseUrl}}/all/members HTTP/1.1
Content-Type: application/json
Authorization: Bearer {{token}}

[{
 "realmId": "rlm-public",
 "email": "[email protected]",
 "userId": "[email protected]",
 "accepted": true,
 "invite": false,
 "permissions": {},
}]

When the token is obtained with ["ACCESS_DB", "GLOBAL_WRITE"], I get HTTP/1.1 403 Forbidden. Not authorized to mutate any data.
When the token is obtained with ["ACCESS_DB", “GLOBAL_READ”, "GLOBAL_WRITE"], I get HTTP/1.1 404 Not Found. Table 'members' was not found in database '<id>'.

However, the following GET of members returns success withHTTP/1.1 200 OK [].

### Get members
GET {{baseUrl}}/all/members HTTP/1.1
Authorization: Bearer {{token}}

Any ideas on what's happening?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions