diff --git a/packages/cli/src/commands/auth/token.ts b/packages/cli/src/commands/auth/token.ts index ecfa8bbd50..789f513e1a 100644 --- a/packages/cli/src/commands/auth/token.ts +++ b/packages/cli/src/commands/auth/token.ts @@ -22,7 +22,7 @@ By default, the CLI auth token is only valid for 1 year. To generate a long-live if (token && token.access_token.expires_in) { const d = new Date() d.setSeconds(d.getSeconds() + token.access_token.expires_in) - this.warn(`token will expire ${formatRelative(d, new Date())}\n${isInternal ? 'All tokens will expire one year after last generation' : `Use ${color.cmd('heroku authorizations:create')} to generate a long-term token`}`) + this.warn(`token will expire ${formatRelative(d, new Date())}\n${isInternal ? 'All tokens expire one year after we generate it.' : `To generate a long-lived token, use ${color.cmd('heroku authorizations:create')}.`}`) } } catch (error: any) { this.warn(error) diff --git a/packages/cli/test/unit/commands/auth/token.unit.test.ts b/packages/cli/test/unit/commands/auth/token.unit.test.ts index e3593b3df6..362d7256a0 100644 --- a/packages/cli/test/unit/commands/auth/token.unit.test.ts +++ b/packages/cli/test/unit/commands/auth/token.unit.test.ts @@ -34,8 +34,8 @@ describe('auth:token', () => { .command(['auth:token']) .it('shows "long-term" token generation warning for non-internal users', ctx => { expect(ctx.stdout).to.equal('foobar\n') - expect(ctx.stderr).to.contain('Use heroku authorizations:create to generate a long-term token') - expect(ctx.stderr).to.not.contain('All tokens will expire one year after last generation') + expect(ctx.stderr).to.contain('To generate a long-lived token, use heroku authorizations:create.') + expect(ctx.stderr).to.not.contain('All tokens expire one year after we generate it.') }) test @@ -53,7 +53,7 @@ describe('auth:token', () => { .command(['auth:token']) .it('shows AT2 token generation warning for internal users', ctx => { expect(ctx.stdout).to.equal('foobar\n') - expect(ctx.stderr).to.contain('All tokens will expire one year after last generation') - expect(ctx.stderr).to.not.contain('Use heroku authorizations:create to generate a long-term token') + expect(ctx.stderr).to.contain('All tokens expire one year after we generate it.') + expect(ctx.stderr).to.not.contain('To generate a long-lived token, use heroku authorizations:create.') }) })