laxy-verify 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth.js +20 -40
- package/package.json +1 -1
package/dist/auth.js
CHANGED
|
@@ -121,48 +121,28 @@ function whoami() {
|
|
|
121
121
|
console.log(" 인증 정보를 읽을 수 없습니다.");
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
if (answered)
|
|
139
|
-
return;
|
|
140
|
-
answered = true;
|
|
141
|
-
if (mute)
|
|
142
|
-
process.stdout.write("\n");
|
|
143
|
-
rl.close();
|
|
144
|
-
rl.removeAllListeners();
|
|
145
|
-
resolve(ans.trim());
|
|
124
|
+
async function login(emailArg) {
|
|
125
|
+
// 단일 readline 인터페이스로 이메일+비밀번호 수집
|
|
126
|
+
// (복수 rl 인스턴스 생성 시 Windows UV_HANDLE_CLOSING Assertion 발생)
|
|
127
|
+
const rl = readline.createInterface({
|
|
128
|
+
input: process.stdin,
|
|
129
|
+
output: process.stdout,
|
|
130
|
+
terminal: false,
|
|
131
|
+
});
|
|
132
|
+
const ask = (prompt) => new Promise((resolve) => rl.question(prompt, (ans) => resolve(ans.trim())));
|
|
133
|
+
const askMuted = (prompt) => new Promise((resolve) => {
|
|
134
|
+
process.stdout.write(prompt);
|
|
135
|
+
rl.once("line", (line) => {
|
|
136
|
+
process.stdout.write("\n");
|
|
137
|
+
resolve(line.trim());
|
|
146
138
|
});
|
|
147
|
-
// 비밀번호 모드에서 라인 이벤트 수동 처리 (일부 Windows 터미널 호환)
|
|
148
|
-
if (mute) {
|
|
149
|
-
rl.on("line", (line) => {
|
|
150
|
-
if (answered)
|
|
151
|
-
return;
|
|
152
|
-
answered = true;
|
|
153
|
-
process.stdout.write("\n");
|
|
154
|
-
rl.close();
|
|
155
|
-
rl.removeAllListeners();
|
|
156
|
-
resolve(line.trim());
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
139
|
});
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
140
|
+
const email = emailArg?.trim() ?? (await ask(" 이메일: "));
|
|
141
|
+
const password = await askMuted(" 비밀번호: ");
|
|
142
|
+
// 입력 완료 후 stdin 핸들 즉시 해제 (Windows Assertion 방지)
|
|
143
|
+
rl.removeAllListeners();
|
|
144
|
+
rl.close();
|
|
145
|
+
process.stdin.destroy();
|
|
166
146
|
console.log("\n 로그인 중...");
|
|
167
147
|
let res;
|
|
168
148
|
try {
|