Hello,
What you’re attempting logging into one site from another is technically possible using an API-based authentication system. You would need to expose a secure login API on the second site and call it from the HTML-based site using something like fetch() or XMLHttpRequest.
However, this approach introduces serious security risks. If someone were to find a way to compromise your HTML-based site, they could potentially gain access to both sites especially if login credentials or session tokens are shared or not securely handled.
Additionally, cross-origin restrictions (CORS) may block your login attempts unless configured explicitly, which opens even more doors for exploitation if not done carefully.
In short:
✅ Possible via API with proper architecture and security practices.
⚠️ Dangerous if not secured especially if one site is less protected than the other.
For best practice, consider implementing centralized authentication through OAuth or a secure SSO (Single Sign-On) solution instead.