Authentication with JWT Laravel 5 without password

后端 未结 3 629
陌清茗
陌清茗 2021-02-05 09:17

I\'m trying to learn Laravel and my goal is to be able to build a RESTful API (no use of views or blade, only JSON results. Later, an AngularJS web app and a Cordova hybrid mobi

3条回答
  •  清歌不尽
    2021-02-05 10:00

    Rather than making a different login strategy for customers and moderators, you can add token authentication to both user type. this will makes your life easier and prepare for scalability. In your api, you can just restrict moderator users to not have access to the api by sending

    'method not allowed')

    Apart from this suggestion, I believe @Alimnjan code should work.

提交回复
热议问题