feat(auth): support server-side Zalo phoneToken decoding with resilient...
Features & Enhancements
1. Zalo Phone Token Resolution (Server-to-Server)
- Updated
ZaloLoginDtoandzaloLoginSchemato supportphoneTokenreturned byzmp-sdk'sgetPhoneNumber(). - Implemented
fetchZaloPhoneNumber()queryingGET https://graph.zalo.me/v2.0/me/infowithaccess_token,code(phoneToken), andsecret_key(ZALO_APP_SECRET). - Automated phone number normalization (e.g., converting
84xxxxxxxxxor+84xxxxxxxxxto Vietnamese domestic standard0xxxxxxxxx).
2. Resilient Hybrid Auth for Global Deployments (Fixes Zalo IP Error -501)
- Handled Zalo Open API geographical restriction (
error: -501: Personal information is limited due to IP address not inside Vietnam) when hosted on global cloud providers (Render/AWS/GCP). - Added graceful fallbacks allowing authentication via client-verified
zaloId/ deterministic identity while still resolving phone numbers when permissible. - Fixed response parsing logic where successful Zalo profile API calls (which do not return an
errorkey) were previously falsely flagged as invalid credentials.