Add authenticate middleware
knownasilya opened this issue · 2 comments
knownasilya commented
Should use the same methods from the router setup, e.g. getUser
knownasilya commented
var auth = justAuth({ ... });
app.use('/auth', auth.router);
app.use('/admin', auth.middleware, adminRouter);
There should be only one middleware, for checking the token, if invalid it sends a 401 and the client can chose to redirect to the login page or whatever.
knownasilya commented
As @ismyrnow mentioned here, we can make our middleware based on the express-authentication library.