Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to display login URL during login #175

Merged
merged 7 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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