Typically one creates a RESTful API so that one can have a completely decoupled front and backend. As a result you typically want to have stateless authentication, i.e. you don't have a session stored in a database but instead your authentication is checked on every request. In this video I show you how you can set up security with JWT (JSON web tokens) to enable said stateless authentication. GitHub:
Hide player controls
Hide resume playing