Skip to content

Add personal access token login method#53

Open
david-uhlig wants to merge 1 commit into
abrom:mainfrom
david-uhlig:feature/add-pat-login
Open

Add personal access token login method#53
david-uhlig wants to merge 1 commit into
abrom:mainfrom
david-uhlig:feature/add-pat-login

Conversation

@david-uhlig
Copy link
Copy Markdown

@david-uhlig david-uhlig commented May 11, 2026

This PR adds the login_with_token method to RocketChat::Server to make logging in with a personal access token (PAT) explicit.

Although, you could do so already by calling:

require "rocketchat"

rocket_server = RocketChat::Server.new('http://your.server.address/')
session = RocketChat::Session.new(rocket_server, RocketChat::Token.new(userId: "user-id", authToken: "pat")

This was undocumented, and I think it's worth it having a login method for PATs that behaves similarly to login.

With the PR the code for creating a session from a PAT becomes:

require "rocketchat"

rocket_server = RocketChat::Server.new('http://your.server.address/')
session = rocket_server.login_with_token("user-id", "pat")

Tested against Rocket Chat 7.10.9.

Thanks for making and maintaining this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant