I am creating routes in node js
. I am creating routes for dashboard.
- User login and get the
JWT token
. - By sending Token,User can access some route related to user(edit,delete,logout route etc).
- But For admin, I want to create the routes which can see the list of users,edit or remove users,check the logout time of users.I have also set the flag in table to identify the person is user or Admin.
How will be authenticate routes for Admins on backend side?