Skip to content

Commit a56bef4

Browse files
chore: Add info about token location to the output (#846)
Co-authored-by: Vlad Frangu <[email protected]>
1 parent 1fa5e21 commit a56bef4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/commands/login.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Server } from 'node:http';
22
import type { AddressInfo } from 'node:net';
33

4+
import chalk from 'chalk';
45
import computerName from 'computer-name';
56
import cors from 'cors';
67
import express from 'express';
@@ -11,6 +12,7 @@ import { cryptoRandomObjectId } from '@apify/utilities';
1112

1213
import { ApifyCommand } from '../lib/command-framework/apify-command.js';
1314
import { Flags } from '../lib/command-framework/flags.js';
15+
import { AUTH_FILE_PATH } from '../lib/consts.js';
1416
import { error, info, success } from '../lib/outputs.js';
1517
import { useApifyIdentity } from '../lib/telemetry.js';
1618
import { getLocalUserInfo, getLoggedClient } from '../lib/utils.js';
@@ -30,7 +32,7 @@ const tryToLogin = async (token: string) => {
3032
if (isUserLogged) {
3133
await useApifyIdentity(userInfo.id!);
3234
success({
33-
message: `You are logged in to Apify as ${userInfo.username || userInfo.id}!`,
35+
message: `You are logged in to Apify as ${userInfo.username || userInfo.id}. ${chalk.gray(`Your token is stored at ${AUTH_FILE_PATH()}.`)}`,
3436
});
3537
} else {
3638
error({
@@ -44,7 +46,7 @@ export class LoginCommand extends ApifyCommand<typeof LoginCommand> {
4446
static override name = 'login' as const;
4547

4648
static override description =
47-
`Authenticates your Apify account and saves credentials to '~/.apify'.\n` +
49+
`Authenticates your Apify account and saves credentials to '${AUTH_FILE_PATH()}'.\n` +
4850
`All other commands use these stored credentials.\n\n` +
4951
`Run 'apify logout' to remove authentication.`;
5052

src/commands/logout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class LogoutCommand extends ApifyCommand<typeof LogoutCommand> {
88
static override name = 'logout' as const;
99

1010
static override description =
11-
`Removes authentication by deleting your API token and account information from '~/.apify'.\n` +
11+
`Removes authentication by deleting your API token and account information from '${AUTH_FILE_PATH()}'.\n` +
1212
`Run 'apify login' to authenticate again.`;
1313

1414
async run() {

0 commit comments

Comments
 (0)