/ archiveofbelonging.org / back / node_modules / koa-passport /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]lib/2 years ago -  
[TXT]CHANGELOG.md40 years ago3.2K 
[   ]LICENSE40 years ago1.1K7375cab EXHIBTION: fix overflow ellipsis cutoff [كارل مبارك]
[TXT]README.md40 years ago1.6Kf12eb36 documentaiton updates [كارل مبارك]
[   ]package.json2 years ago1.6K7375cab EXHIBTION: fix overflow ellipsis cutoff [كارل مبارك]
README.md

koa-passport

Passport middleware for Koa

NPM Dependency Status Build Status

koa-passport version koa version branch
1.x 1.x v1.x
2.x 2.x v2.x
4.x 2.x master

Migration to v3

Usage

// body parser
const bodyParser = require('koa-bodyparser')
app.use(bodyParser())

// Sessions
const session = require('koa-session')
app.keys = ['secret']
app.use(session({}, app))

const passport = require('koa-passport')
app.use(passport.initialize())
app.use(passport.session())

Example Application

Passport's values and methods are exposed as follows:

app.use(async ctx => {
  ctx.isAuthenticated()
  ctx.isUnauthenticated()
  await ctx.login()
  ctx.logout()
  ctx.state.user
})

License

MIT

Apache/2.4.38 (Debian) Server at www.karls.computer Port 80