Skip to content

Commit

Permalink
Merge pull request #175 from Dannomac/display-login-url
Browse files Browse the repository at this point in the history
Added option to display login URL during login
  • Loading branch information
motdotla committed Dec 6, 2022
2 parents a9301ce + dad2bcc commit 92f4c54
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/services/login-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class LoginService {

async login(tip = true): Promise<void> {
if (!this.yes) {
CliUx.ux.url(`Login URL: ${this.loginUrl}`, this.loginUrl)
const answer = await CliUx.ux.prompt(`${chalk.dim(this.log.pretextLocal)}Press ${chalk.green('y')} (or any key) to open up the browser to login and generate credential (.env.me) or ${chalk.yellow('q')} to exit`)
if (answer === 'q' || answer === 'Q') {
this.abort.quit()
Expand Down
1 change: 1 addition & 0 deletions src/services/logout-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class LogoutService {

async logout(tip = true): Promise<void> {
if (!this.yes) {
CliUx.ux.url(`Logout URL: ${this.logoutUrl}`, this.logoutUrl)
const answer = await CliUx.ux.prompt(`${chalk.dim(this.log.pretextLocal)}Press ${chalk.green('y')} (or any key) to logout and revoke credential (.env.me) or ${chalk.yellow('q')} to exit`)
if (answer === 'q' || answer === 'Q') {
this.abort.quit()
Expand Down
1 change: 1 addition & 0 deletions src/services/new-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class NewService {
}

if (!this.yes) {
CliUx.ux.url(`New project URL: ${this.urlWithProjectName}`, this.urlWithProjectName)
const answer = await CliUx.ux.prompt(`${chalk.dim(this.log.pretextLocal)}Press ${chalk.green('y')} (or any key) to open up the browser to create a new project vault (.env.vault) or ${chalk.yellow('q')} to exit`)
if (answer === 'q' || answer === 'Q') {
this.abort.quit()
Expand Down
1 change: 1 addition & 0 deletions src/services/open-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class OpenService {
}

if (!this.yes) {
CliUx.ux.url(`Project URL: ${this.openUrl}`, this.openUrl)
const answer = await CliUx.ux.prompt(`${chalk.dim(this.log.pretextLocal)}Press ${chalk.green('y')} (or any key) to open up the browser to view your project or ${chalk.yellow('q')} to exit`)
if (answer === 'q' || answer === 'Q') {
this.abort.quit()
Expand Down
1 change: 1 addition & 0 deletions src/services/status-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class StatusService {

async run(): Promise<void> {
if (!this.yes) {
CliUx.ux.url(`Status URL: ${this.statusUrl}`, this.statusUrl)
const answer = await CliUx.ux.prompt(`${chalk.dim(this.log.pretextLocal)}Press ${chalk.green('y')} (or any key) to open up the browser to view the dotenv-vault status page or ${chalk.yellow('q')} to exit`)
if (answer === 'q' || answer === 'Q') {
this.abort.quit()
Expand Down

0 comments on commit 92f4c54

Please sign in to comment.