Skip to content

Commit

Permalink
Update copy
Browse files Browse the repository at this point in the history
  • Loading branch information
zwhitfield3 committed Apr 8, 2024
1 parent ae05ad9 commit c5255ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/cli/src/commands/auth/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/test/unit/commands/auth/token.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.')
})
})

0 comments on commit c5255ab

Please sign in to comment.