Is it possible to make Laravel Sanctum work with tokens and auth at the same time?

441 views Asked by At

I'm currently using Laravel with VueJS for a web app. Using Sanctum for the API works great.

However, I also created a small Android app. This android app requires the token creation in order to authenticate. To make it work, I have to remove the following line from the Kernel API section, as otherwise I'm getting a 419:

EnsureFrontendRequestsAreStateful::class

Now, that's the problem: If I remove it, it will work on with the Android app but it won't work in the web app, and viceversa.

I guess I can remove it and create tokens for the web version too? Although I'm using Laravel standard login.

What do you think would be the best approach here?

0

There are 0 answers