GSI - Employe Self Service Mobile
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
1.3 KiB

2 months ago
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.command = void 0;
  4. const clc = require("colorette");
  5. const command_1 = require("../command");
  6. const error_1 = require("../error");
  7. const logger_1 = require("../logger");
  8. const auth = require("../auth");
  9. const utils = require("../utils");
  10. exports.command = new command_1.Command("login:ci")
  11. .description("generate an access token for use in non-interactive environments")
  12. .option("--no-localhost", "copy and paste a code instead of starting a local server for authentication")
  13. .action(async (options) => {
  14. if (options.nonInteractive) {
  15. throw new error_1.FirebaseError("Cannot run login:ci in non-interactive mode.");
  16. }
  17. utils.logWarning("Authenticating with a `login:ci` token is deprecated and will be removed in a future major version of `firebase-tools`. " +
  18. "Instead, use a service account key with `GOOGLE_APPLICATION_CREDENTIALS`: https://cloud.google.com/docs/authentication/getting-started");
  19. const userCredentials = await auth.loginGoogle(options.localhost);
  20. logger_1.logger.info();
  21. utils.logSuccess("Success! Use this token to login on a CI server:\n\n" +
  22. clc.bold(userCredentials.tokens.refresh_token || "") +
  23. '\n\nExample: firebase deploy --token "$FIREBASE_TOKEN"\n');
  24. return userCredentials;
  25. });