Appearance
ts logout
Sign out of the targeted server by discarding the sign-in ts keeps for it. Add --revoke when that sign-in may have been exposed and you want it to stop working, not just to leave this machine.
Usage
text
ts logout [--revoke]Description
ts logout deletes the stored sign-in for the targeted server and nothing else. It is a local operation, so it works while the server is down, and it leaves the session on the server open until it ends on its own.
Sign-ins are kept per server. ts logout affects only the server the invocation targets, the one --server, TSSERVER or the default names, so signing out of staging leaves production signed in.
--revoke first asks the server to revoke the session's refresh token, which ends the session: nothing can renew it, and the access token already issued expires within five minutes. It ends this sign-in only; your sign-ins on other machines and in the Administration site stay open. A client's sign-in made with --client-id holds no refresh token and no session, so --revoke deletes it as plain ts logout does; to stop the client itself, rotate or revoke its secret with ts client.
The revocation happens before the stored sign-in is deleted. If the server cannot be reached, the command fails and the sign-in stays stored, so you can retry once the server is back, or run plain ts logout to clear it in the meantime.
Options
| Flag | Description | Default/Values | Notes |
|---|---|---|---|
--revoke | Also revoke this session on the server. | Requires the server to be reachable. |
Examples
bash
# Sign out of the default server
ts logout
# Sign out of one server without disturbing the others
ts --server=https://staging.example.net logout
# The credentials file may have been copied: end the session as well
ts logout --revokeOutput
text
Signed out of turbo.example.netWith --revoke:
text
Signed out of turbo.example.net and revoked this sessionExit Codes
0 on success. -1 when there is no stored sign-in for the targeted server, or no server is configured at all. -3 with --revoke when the server cannot be reached; nothing was revoked and the sign-in is still stored.
