RocketChat / RocketChat/Rocket.Chat

[BUG] login via API doesn't update User Status, Created at and Last login

Open
#7,745 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

A login via API doesn't update User Status, "Created at" and "Last login" (view-full-other-user-info)

Server Setup Information:
  • Version of Rocket.Chat Server: 0.57.3
  • Operating System: Linux, Ubuntu 16.04 LTS
  • Deployment Method(snap/docker/tar/etc): github checkout, self build bundle
  • Number of Running Instances: 1
  • DB Replicaset Oplog: yes
  • Node Version: v4.5.0
Steps to Reproduce:

Login via REST API e.g. using curl, post a message and logout

# GET authToken
AUTHTOKEN="$(curl -s ${SERVER}/api/v1/login -d "username=${USERNAME}&password=${PASSWORD}" | grep "authToken" | cut -d"\"" -f4)"

### echo $AUTHTOKEN

# post message
curl -s -H "X-Auth-Token: ${AUTHTOKEN}" \
     -H "X-User-Id: ${USERID}" \
     -H "Content-type:application/json" \
     ${SERVER}/api/v1/chat.postMessage \
     -d '{"channel": "#'${CHANNEL}'", "text": "'"${MSG}"'"}'

# logout                
curl -H "X-Auth-Token: ${AUTHTOKEN}" \
     -H "X-User-Id: ${USERID}" ${SERVER}/api/v1/logout
Expected behavior:

To my mind "Last login" shown in the webinterface should be updated, as well as "online status" if not logged out.

Actual behavior:

"Last login" in the webinterface is not updated.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the REST /api/v1/login entry point and compare its user-status and timestamp behavior with the logout flow described in the reproduction. Verify the API login, message post, and logout sequence, then confirm that User Status, Created at, and Last login show the expected values in the web interface.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.