Skip to content

ookejimift/s3o-middleware

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

S3O-middleware

Middleware to handle authenticating with S3O

Parsing cookies

This middleware can parse standard cookies via the cookie package. If wanting to use signed cookies or json cookies, please use the cookie-parser middleware before using the S3O middleware.

Usage example for Express

If many routes require auth:

var express = require('express');
var app = express();

// Add routes here which don't require auth
var authS3O = require('s3o-middleware');
app.use(authS3O);
// Add routes here which require auth

If only paths within a given directory require auth:

var express = require('express');
var app = express();
var router = express.Router();
var authS3O = require('s3o-middleware');
router.use(authS3O);
app.use('/admin', router);

If specific paths require auth:

var express = require('express');
var app = express();
var router = express.Router();
var authS3O = require('s3o-middleware');

app.get('/', authS3O, router);
app.post('/', authS3O);

About

Middleware to handle authenticating with S3O

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%