@@ -6,23 +6,16 @@ const { globalConfig, localConfig } = require("../config");
6
6
const { actionRunner, success, parseBool, commandDescriptions, error, parse, log, drawTable } = require("../parser");
7
7
const ID = require("../id");
8
8
{% if sdk .test != " true" %}
9
- const { questionsLogin, questionLoginWithEndpoint, questionsLogout, questionsListFactors, questionsMfaChallenge } = require("../questions");
10
- const { accountCreate, accountUpdateMfaChallenge, accountCreateMfaChallenge, accountGet, accountCreateEmailPasswordSession, accountDeleteSession } = require("./account");
9
+ const { questionsLogin, questionsLogout, questionsListFactors, questionsMfaChallenge } = require("../questions");
10
+ const { accountUpdateMfaChallenge, accountCreateMfaChallenge, accountGet, accountCreateEmailPasswordSession, accountDeleteSession } = require("./account");
11
11
12
12
const DEFAULT_ENDPOINT = 'https://cloud.appwrite.io/v1';
13
13
14
- const loginCommand = async ({ selfHosted, email, password, endpoint, mfa, code }) => {
14
+ const loginCommand = async ({ email, password, endpoint, mfa, code }) => {
15
15
const oldCurrent = globalConfig.getCurrentLogin();
16
- let answers = {};
17
- let configEndpoint = DEFAULT_ENDPOINT;
18
-
19
- if (selfHosted) {
20
- answers = endpoint && email && password ? { endpoint, email, password } : await inquirer.prompt(questionLoginWithEndpoint);
21
- configEndpoint = answers.endpoint;
22
- } else {
23
- answers = email && password ? { email, password } : await inquirer.prompt(questionsLogin);
24
- }
16
+ let configEndpoint = endpoint ?? DEFAULT_ENDPOINT;
25
17
18
+ const answers = email && password ? { email, password } : await inquirer.prompt(questionsLogin);
26
19
27
20
if (answers.method === 'select') {
28
21
const accountId = answers.accountId;
@@ -138,7 +131,6 @@ const whoami = new Command("whoami")
138
131
139
132
const login = new Command("login")
140
133
.description(commandDescriptions['login'])
141
- .option(`-sh, --self-hosted`, `Flag for enabling custom endpoint for self hosted instances`)
142
134
.option(`--email [email]`, `User email`)
143
135
.option(`--password [password]`, `User password`)
144
136
.option(`--endpoint [endpoint]`, `Appwrite endpoint for self hosted instances`)
0 commit comments