Skip to content

Commit e66376b

Browse files
committed
feat(scripts): login-verify.sh — login an account + verify store write
Login commands without a post-write check left 3 OAuth logins lost (wrote to ephemeral container fs once, then a mount/config switch cleared ./data/auth). This script aborts loudly when the store file doesn't appear after a successful login.
1 parent 25f63aa commit e66376b

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎scripts/login-verify.sh‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
# Login + verify per acc: credentials.json must appear in ./data/auth after each.
3+
set -e
4+
cd /home/longphamdev/codespaces/zcode-api
5+
LABEL=$1
6+
echo "=== Login $LABEL — mở URL, authorize, đợi hoàn tất..."
7+
docker run --rm -it -v /home/longphamdev/codespaces/zcode-api/data/auth:/data/auth zcode-proxy:local bun /app/index.js auth login zai --label "$LABEL"
8+
if [ -f ./data/auth/credentials.json ]; then
9+
echo "✓ credentials.json EXISTS in ./data/auth"
10+
python3 -c "
11+
import json
12+
d = json.load(open('./data/auth/credentials.json'))
13+
print('✓ accounts in store:', len(d.get('accounts', [])))
14+
"
15+
else
16+
echo "✗ credentials.json NOT written — something is wrong, stop and investigate"
17+
exit 1
18+
fi

0 commit comments

Comments
 (0)