4 months ago

Cookie auth in API routes

Posted 4 months ago by mcardosob

I am building a laravel API that be consumed by my frontend (javascript).

Until now, I login my user and send a token in body response. And I consume the token with my frontend.

In my frontend app, I need to download an audio resource with the audio tag (html). To load my audio, I need to be authenticated, but I can't send auth headers with the audio tag. So the only solution is to authenticate my app with cookie token.

Can I use authenticate my user with cookies in my api routes ?

Please sign in or create an account to participate in this conversation.