shellbase 0.1.3 → 0.1.4
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 +2 -0
- package/dist/session.js +8 -3
- package/package.json +1 -1
package/dist/auth.js
CHANGED
|
@@ -54,6 +54,8 @@ export async function whoami() {
|
|
|
54
54
|
const { cb, memberId } = await requireClient();
|
|
55
55
|
const me = await cb.auth.getMe();
|
|
56
56
|
console.log(`${me.nickname}${me.email ? ` <${me.email}>` : ''} (member_id: ${memberId})`);
|
|
57
|
+
const autoApprove = me.custom_data?.auto_approve === true;
|
|
58
|
+
console.log(`계정 자동 승인 설정: ${autoApprove ? '켜짐 (웹에서 껐다켤 수 있어요)' : '꺼짐'}`);
|
|
57
59
|
}
|
|
58
60
|
export async function requireClient() {
|
|
59
61
|
const creds = loadCredentials();
|
package/dist/session.js
CHANGED
|
@@ -32,9 +32,14 @@ export async function startSession(options) {
|
|
|
32
32
|
deviceName,
|
|
33
33
|
frameKey: generateFrameKey(),
|
|
34
34
|
};
|
|
35
|
+
// 계정 설정(웹의 "새 세션 자동 승인" 토글, custom_data.auto_approve)이 켜져 있으면
|
|
36
|
+
// --auto-approve 를 안 줘도 자동 승인. 계정 단위라 이 계정으로 로그인한 모든 컴퓨터에 적용됨.
|
|
37
|
+
const me = await cb.auth.getMe();
|
|
38
|
+
const accountAutoApprove = me.custom_data?.auto_approve === true;
|
|
39
|
+
const autoApprove = options.autoApprove === true || accountAutoApprove;
|
|
35
40
|
console.log(`"${deviceName}" 세션을 시작해요 (작업 폴더: ${cwd})`);
|
|
36
|
-
if (
|
|
37
|
-
console.log('
|
|
41
|
+
if (autoApprove) {
|
|
42
|
+
console.log(`⚠️ 자동 승인이 켜져 있어요${accountAutoApprove ? ' (계정 설정)' : ' (--auto-approve)'} — 접속 요청을 묻지 않고 자동 승인해요. 내 계정에 들어올 수 있는 사람은 누구나 곧바로 입력할 수 있어요.`);
|
|
38
43
|
}
|
|
39
44
|
const deviceRowId = await registerDevice(cb, {
|
|
40
45
|
ownerId: memberId,
|
|
@@ -104,7 +109,7 @@ export async function startSession(options) {
|
|
|
104
109
|
if (approvalInFlight)
|
|
105
110
|
return;
|
|
106
111
|
approvalInFlight = true;
|
|
107
|
-
const approval =
|
|
112
|
+
const approval = autoApprove
|
|
108
113
|
? Promise.resolve(true)
|
|
109
114
|
: promptApproval('\n📱 모바일에서 접속을 요청했어요. 입력을 허용할까요? (y/N, 30초 내 미응답 시 자동 거부): ', APPROVAL_TIMEOUT_MS);
|
|
110
115
|
approval
|