0.2.1 • Published 7 years ago

yion-oauth v0.2.1

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

YION OAUTH PLUGIN

A OAuth plugin for framework Yion

You need a OAuth authorize token server

Install

$ npm install --save yion-oauth

Usage

const { createServer, createApp } = require('yion');
const security = require('yion-oauth')(urlToValidateToken, methodOfUrl);

const app = createApp();
const server = createServer(app, [security]);

app.get('/', (req, res) => {
    req.isAuthenticated().then().catch(); 
});

API reference

Response render method :

  • isAuthenticated(token=null): call OAuth authorize server to validate token (from headers'Authorization' or from token parameter)
0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago