1.0.3 • Published 6 years ago

flightworker-atk-auth v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

flightworker-atk-auth

中间件部署

// API服务器
const auth = require('flightworker-atk-auth')
const middleware = config => (req, res, next) => {
    const $auth = auth({...})
    $auth.once('success', status => {
        next()
    })
    $auth.on('error', e => next())
    return auth.check(req, res)
}
// AMN or APN
const auth = require('flightworker-atk-auth')
const middleware = config => (req, res, next) => {
    const $auth = auth({...})
    $auth.once('token', token => {
        // todo 请将token发送至API配置的获取token的地址上
        next()
    })
    $auth.on('error', e => next())
    return auth.middleware(req, res)
}
1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago