REST API created user accounts not found a day after creation and successful usage

Hi,

We built a system that inserts a Rocketchat chat window using an iframe. All of our code works, we have Java middle ware that creates accounts in Rocketchat and users are successfully joined to a channel and they can post and chat in the iframe.

However, very consistently a day after the user returns the account doesn’t work. I tried Postman to see if I can either login or retrieve data using the generated username/password and I get an ‘unauthorized’ response back.

When I look in the console of our Rocketchat Docker image (4.3.2) I see this:

{"level":50,"time":"2022-01-29T13:55:51.788Z","pid":9,"hostname":"731616dc3f8a","name":"System","msg":"Exception while invoking method login 'User not found [403]'"}

If I use Postman and admin credentials to get info on one of the created users I get for example:

{
    "user": {
        "_id": "kKMq6bBNK2u5iQkHH",
        "createdAt": "2022-01-28T16:17:59.638Z",
        "services": {},
        "username": "*******",
        "emails": [
            {
                "address": "********",
                "verified": true
            }
        ],
        "type": "user",
        "status": "offline",
        "active": true,
        "roles": [
            "user"
        ],
        "name": "*********",
        "requirePasswordChange": false,
        "lastLogin": "2022-01-28T20:59:27.704Z",
        "canViewAllInfo": true
    },
    "success": true
}

When I use Postman to retrieve the status of that user I get:

{
    "_id": "kKMq6bBNK2u5iQkHH",
    "status": "offline",
    "success": true
}

Any idea what is going on here? I’m pretty much tapped out with respect to solution paths.

Cheers,

Martin

Some additional information: when we use the endpoint ‘login’, using either Postman or the code we wrote, we get:

{
  "status":"error",
  "error":"Unauthorized",
  "message":"Unauthorized"
}