Jwt-auth: [Question] Integrating jwt-auth with roles and permissions route

Created on 4 Oct 2016  路  4Comments  路  Source: tymondesigns/jwt-auth

Hi Everybody,
When using the Jwt-auth, I met the issue: the user logged in using Jwt-auth and then user go to the new route "/abc" this route need to permission (such as admin role) :

    Route::get('/abc', 'PagesController@abc');

Because user already loggin, so now how to check user's permission and role for this route? My solution : check permission in "Controller" but it is not good solution.
Please help me the solution for this case.
Thanks.

Most helpful comment

All 4 comments

Use middlware for that if the user authinticated you can check his role .

Hi @engAhmad ,
Can you give me the example?
Thank you

Thank @engAhmad .

Was this page helpful?
0 / 5 - 0 ratings

Related issues

johncloud200 picture johncloud200  路  3Comments

therealmjk picture therealmjk  路  3Comments

marciomansur picture marciomansur  路  3Comments

CBR09 picture CBR09  路  3Comments

loic-lopez picture loic-lopez  路  3Comments