rkusa / Koa Passport
Licence: mit
Passport middleware for Koa
Stars: ✭ 748
Programming Languages
javascript
184084 projects - #8 most used programming language
Projects that are alternatives of or similar to Koa Passport
Vue Koa Demo
🔰A simple full stack demo(CSR & SSR & Docker Support) written by Vue2 & Koa2(Koa1 verson also completed)
Stars: ✭ 730 (-2.41%)
Mutual labels: koa, koa2
Node Typescript Koa Rest
REST API boilerplate using NodeJS and KOA2, typescript. Logging and JWT as middlewares. TypeORM with class-validator, SQL CRUD. Docker included. Swagger docs, actions CI and valuable README
Stars: ✭ 739 (-1.2%)
Mutual labels: koa, koa2
Koahub
KoaHub.js -- 中文最佳实践Node.js Web快速开发框架。支持Koa.js, Express.js中间件。当前项目已停止维护,推荐使用Doodoo.js
Stars: ✭ 308 (-58.82%)
Mutual labels: koa, koa2
react-isomorphic-bundle
React Redux Universal (isomorphic) bundle
Stars: ✭ 53 (-92.91%)
Mutual labels: koa, passport
Egg
🥚 Born to build better enterprise frameworks and apps with Node.js & Koa
Stars: ✭ 17,616 (+2255.08%)
Mutual labels: koa, koa2
Koa Rest Api Boilerplate
💯 Boilerplate for Node.js Koa RESTful API application with Docker, Swagger, Jest, CodeCov and CircleCI
Stars: ✭ 420 (-43.85%)
Mutual labels: koa, koa2
Agile-Server
A simple, fast, complete Node.js server solution, based on KOA. 简单快速的 、性能强劲的、功能齐全的 node 服务器解决方案合集,基于 KOA。
Stars: ✭ 24 (-96.79%)
Mutual labels: koa, koa2
koa2-winston
koa2 version winston logger like express-winston
Stars: ✭ 37 (-95.05%)
Mutual labels: koa, koa2
express-to-koa
Use express middlewares in Koa2, the one that really works.
Stars: ✭ 18 (-97.59%)
Mutual labels: koa, koa2
inversify-koa-utils
inversify-koa-utils is a module based on inversify-express-utils. This module has utilities for koa 2 applications development using decorators and IoC Dependency Injection (with inversify)
Stars: ✭ 27 (-96.39%)
Mutual labels: koa, koa2
Passport Magic Login
Passwordless authentication with magic links for Passport.js.
Stars: ✭ 493 (-34.09%)
Mutual labels: authentication, passport
koa-passport
Passport middleware for Koa
koa-passport version | koa version | branch |
---|---|---|
1.x | 1.x | v1.x |
2.x | 2.x | v2.x |
4.x | 2.x | master |
v3
Migration to - change
ctx.passport.*
toctx.state.*
(e.g.ctx.passport.user
toctx.state.user
) - don't call passport methods on
ctx.req
(e.g. usectx.login
instead ofctx.req.login
) - update custom authentication callback arguments to
err, user, info, status
(e.g.passport.authenticate('local', function(err, user, info, status) { ... })(ctx, next)
)
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())
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
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].