@@ -6,42 +6,11 @@ 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 { questionsRegister, questionsRegisterWithEndpoint, questionsLogin, questionLoginWithEndpoint, questionsLogout, questionsListFactors, questionsMfaChallenge } = require("../questions");
9
+ const { questionsLogin, questionLoginWithEndpoint, questionsLogout, questionsListFactors, questionsMfaChallenge } = require("../questions");
10
10
const { accountCreate, accountUpdateMfaChallenge, accountCreateMfaChallenge, accountGet, accountCreateEmailPasswordSession, accountDeleteSession } = require("./account");
11
11
12
12
const DEFAULT_ENDPOINT = 'https://cloud.appwrite.io/v1';
13
13
14
- const registerCommand = async ({ selfHosted, email, password, endpoint, name }) => {
15
- let answers;
16
- let configEndpoint = DEFAULT_ENDPOINT;
17
-
18
- if (selfHosted) {
19
- answers = endpoint && email && password ? { endpoint, email, password } : await inquirer.prompt(questionsRegisterWithEndpoint);
20
- configEndpoint = answers.endpoint;
21
- } else {
22
- answers = email && password ? { email, password } : await inquirer.prompt(questionsRegister);
23
- }
24
-
25
- globalConfig.setEndpoint(configEndpoint);
26
-
27
- let client = await sdkForConsole(false);
28
-
29
- try {
30
- await accountCreate({
31
- userId: ID.unique(),
32
- email: answers.email,
33
- password: answers.password,
34
- parseOutput: false,
35
- name: answers.name,
36
- sdk: client,
37
- })
38
-
39
- success();
40
- } catch (e) {
41
- throw e;
42
- }
43
-
44
- }
45
14
const loginCommand = async ({ selfHosted, email, password, endpoint, mfa, code }) => {
46
15
const oldCurrent = globalConfig.getCurrentLogin();
47
16
let answers = {};
@@ -180,15 +149,6 @@ const login = new Command("login")
180
149
})
181
150
.action(actionRunner(loginCommand));
182
151
183
- const register = new Command("register")
184
- .description(commandDescriptions['login'])
185
- .option(`-sh, --self-hosted`, `Flag for enabling custom endpoint for self hosted instances`)
186
- .option(`--name [name]`, `User name`)
187
- .option(`--email [email]`, `User email`)
188
- .option(`--password [password]`, `User password`)
189
- .option(`--endpoint [endpoint]`, `Appwrite endpoint for self hosted instances`)
190
- .action(actionRunner(registerCommand));
191
-
192
152
const singleLogout = async (accountId) => {
193
153
try {
194
154
let client = await sdkForConsole();
@@ -349,7 +309,6 @@ module.exports = {
349
309
loginCommand,
350
310
whoami,
351
311
login,
352
- register,
353
312
logout,
354
313
{% endif %}
355
314
migrate,
0 commit comments