Unofficial UserApp Express middleware to authenticate requests.
npm install express-userapp --save
This middleware parses in the cookies of the incoming request for the ua_session_token
. With that token, the user data associated with it will be placed on the request object at req.userapp.user
Use for all routes or on a individual routes.
var express = require('express');
var UserApp = require('userapp');
var authenticate = require('express-userapp');
var app = express();
var APP_ID = 'userapp_app_id';
UserApp.initialize({appId: APP_ID});
app.use(authenticate(/* optionally put appId here */));
app.get('/self', function (req, res) {
// If the user does not authenticate
res.send(req.userapp.user);
});
app.listen(8000);
- Add support for permissions and feature flags
npm install
npm test