Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

bmadigan's avatar

SPA Login best practices.

Hi. Currently developing an SPA that will access an API Backend. eg. GreatNewApp.com (SPA) eg. SomeAPI.com (Backend obviously)

Currently, using JWT to pass back to the SPA (Over HTTPS)

Question is: What is the best way for the SPA to send the API an Email and Password. I currently have it so a FORM POST -> Email and Password to the Backend, but I'm told that it's not the way to do it.

So anyone can help with 'How to authenticate' a user on the initial load (before JWT Token).

Thanks

0 likes
1 reply

Please or to participate in this conversation.