vendredi 20 juillet 2018

How to use auth middleware for external APIS

i am wondering how can i use auth middleware to protect authenticated routes in laravel? I have backend logics/apis on node.js and i m developing the frontend on laravel.

There few routes such as user profile admin profile etc. which i want to protect using auth guard. I know bit about auth middleware. If its a complete laravel project where database backend everything is handle by laravel then its an easy task, but for my case backend is sitting somewhere else.

Shall i be making new middleware with my own custom function or there is way to modify the existing auth middleware somehow and use it .

And if i make a custom guard middleware, how can i check if user is logged in or not from the blade.

In normal project we can use

@if(Auth::check())  <do something @endif 

But in case of custom guard middleware how can i do so ??



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire