vueniverse
vueniverse copied to clipboard
Admin interface
Admin Interface
Time to create a legit admin interface for this project. It should include
-
[x] Admin's should sign-in at the same place everyone else does.
-
[ ]
/admin
: An admin home page, with quick insights related to page views and statistical graphs. -
[x]
/admin/users
: A queryable user table using vuetify data tables, #6 and some server side magic. Admins should have the ability to revoke tokens from users, delete users, or revoke their current passwords. -
[x] Protecting routes on the API should be as simple as throwing an option in the authenticate middleware. ex:
router.get('/admin', authenticate({ role: ['admin', 'owner'] }), index.get)
-
[x] "401 Unauthorized" errors should follow suit with express-server-error.js.
what would you need for /admin homepage and how to access the admin route?
$store.state.user.role === 'admin' to access the admin route. There is also server validation in the authentication middleware if you want to actually see any data. I can make you an admin if you want to check it out in the demo!