Package Exports
- grant-profile
- grant-profile/lib/client
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (grant-profile) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
grant-profile
User profile middleware for Grant.
var express = require('express')
var session = require('express-session')
var grant = require('grant-express') // or require('grant').express()
var profile = require('grant-profile').express()
var config = require('./config.json')
express()
.use(session())
.use(grant(config))
.use(profile(config))
.use('/hi', (req, res) => {
var {response, profile} = req.session.grant
res.end(JSON.stringify({response, profile}, null, 2))
})
.listen(3000){
"defaults": {
"protocol": "http",
"host": "localhost:3000",
"transport": "session",
"callback": "/hi"
},
"google": {"key": "...", "secret": "..."},
"twitter": {"key": "...", "secret": "..."}
}