If you're using React and Redux, this tutorial explains the concept of logging in with an API pretty well: auth0.com/blog/secure-your-react-and-redux-app-wi… They also offer their own authentication server if you need one. Never tried it thought so YMMV.