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

Improves login experience when no localhost is available. #4147

Merged
merged 13 commits into from
Feb 10, 2022
Prev Previous commit
Next Next commit
Update output of --remote
  • Loading branch information
mbleigh committed Jan 12, 2022
commit d69072d96df3d41572abe4ade11df83c80bfde7f
17 changes: 9 additions & 8 deletions src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,17 +442,18 @@ async function loginRemotely(userHint?: string): Promise<UserCredentials> {
const loginUrl = `${api.authProxyOrigin}/login?code_challenge=${codeChallenge}&session=${sessionId}&attest=${attestToken}`;

logger.info();
logger.info("Visit this URL on any device to sign into Firebase CLI:");
logger.info(loginUrl);
logger.info("To sign in to the Firebase CLI:");
logger.info();
logger.info(
"When authentication is complete, confirm that the session ID in the browser matches what is printed below, then paste the provided code."
);
logger.info("1. Take note of your session ID:");
logger.info();
logger.info(`${bold("Session ID:")} ${sessionId}`);
logger.info(` ${bold(sessionId.substring(0, 5).toUpperCase())}`);
logger.info();
logger.info("2. Visit the URL below on any device and follow the instructions to get your code:");
logger.info();
logger.info(` ${loginUrl}`);
logger.info();
logger.info("3. Paste or enter the authorization code below once you have it:");
logger.info();

open(loginUrl);

const code = await promptOnce({
type: "input",
Expand Down