eggjs/koa-passport

Name: koa-passport

Owner: egg

Description: Passport middleware for Koa

Forked from: rkusa/koa-passport

Created: 2017-02-17 15:21:38.0

Updated: 2017-11-06 16:06:49.0

Pushed: 2017-01-30 08:27:43.0

Homepage:

Size: 87

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

koa-passport

Passport middleware for Koa

NPM Dependency Status Build Status

koa-passport version | koa version | branch | npm tag ——————— | ————| —— | ——- 1.x | 1.x | v1.x | latest 2.x | 2.x | v2.x | next 3.x | 2.x | master |

Migration to v3.0.0-rc.3
Usage
ody parser
t bodyParser = require('koa-bodyparser')
use(bodyParser())

essions
t convert = require('koa-convert') // necessary until koa-generic-session has been updated to support koa@2
t session = require('koa-generic-session')
keys = ['secret']
use(convert(session()))

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

Example Application

Passport's values and methods are exposed as follows:

use(async ctx => {
x.isAuthenticated()
x.isUnauthenticated()
x.login()
x.logout()
x.state.user

License

MIT


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.