mardi 2 avril 2019

Use Passport token in web route Laravel

I have an API with Passport.

And if I call, from my frontend for example

"api/getData"

And it works fine. I send to my backend the access token and I can make check via middleware if user that makes a request is Logged or no.

Now If I would make a call to WEB route with passport token such as:

"mysite/dowload/something"

Where in this route I want know if my user is Logged or not.

Can I do it with passport token? Because the web routes have Session and Token no. And obviously if I try to get user with:

Auth::user()

In my controller I get a null value.

Can I check in web route if user is logged via token?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2HUlWeq
via IFTTT

Aucun commentaire:

Enregistrer un commentaire