Fix missing API key extraction in standalone verify flow

CRITICAL BUG: When running --verify-email-code separately (not during registration),
the script was not extracting the API key from the verification response.

Problem:
- Registration flow had API key extraction code (line 387-393)
- Standalone verify flow was missing it (line 445)
- API key returned by API but not saved to config

Solution:
- Added API key extraction to standalone verification flow
- Now both flows extract and save the API key properly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-01-24 23:30:43 +01:00
parent b9e86c8fae
commit 27705ee279

View File

@@ -445,6 +445,15 @@ if [ "$VERIFIED" != "true" ]; then
if echo "$VERIFY_RESPONSE" | grep -q '"verified":true'; then if echo "$VERIFY_RESPONSE" | grep -q '"verified":true'; then
echo "✅ Email verified successfully!" echo "✅ Email verified successfully!"
echo "" echo ""
# Extract API key from verification response
VERIFIED_API_KEY=$(echo "$VERIFY_RESPONSE" | jq -r '.api_key // ""')
if [ -n "$VERIFIED_API_KEY" ] && [ "$VERIFIED_API_KEY" != "null" ]; then
SAAC_API_KEY="$VERIFIED_API_KEY"
echo "🔑 API key received and saved"
echo ""
fi
VERIFIED=true VERIFIED=true
save_config save_config
echo "" echo ""