Skip to content

Commit

Permalink
Fix login command (#2460)
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyKirakosyan authored Sep 29, 2023
1 parent 8a3f759 commit 9930a9d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/commands/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ export default class LoginCommand extends Command {
}

const endpoint = environments(this.environmentName).endpoint;
out.text(`endpoint and token ${endpoint}, ${token}`);
const client = this.clientFactory.fromToken(token, endpoint);
const userResponse = await out.progress("Getting user info ...", client.users.get());

await saveUser(userResponse, { id: "SuppliedByUser", token: this.token }, this.environmentName, userSuppliedToken);
await saveUser(userResponse, { id: "UserToken", token: token }, this.environmentName, userSuppliedToken);
out.text(`Logged in as ${userResponse.name}`);
// Force early exit to avoid long standing delays if token deletion is slow
process.exit(0);
Expand Down

0 comments on commit 9930a9d

Please sign in to comment.