diff --git a/README.md b/README.md index 06cb598e..a73ecdba 100644 --- a/README.md +++ b/README.md @@ -117,6 +117,25 @@ Follow these steps to add Stormpath user authentication to your Express.js app. //... }); ``` + + The `stormpath.authenticationRequired` middleware depends on the `cookie-parser` middleware, make sure that you are including the `cookie-parser` prior to all of your secured routes: + + ```javascript + var express = require('express'); + var stormpath = require('express-stormpath'); + var cookieParser = require('cookie-parser'); + + var app = express(); + + // Include the cookier-parser middleware prior to securing the route with 'stormpath.authenticationRequired' + app.use(cookieParser()); + app.use(stormpath.init(application, stormpathConfiguration)); + + + app.get('/secret', stormpath.authenticationRequired, function(req, res){ + //... + }); + ``` For API services that use HTTP Basic Auth, use `stormpath.apiAuthenticationRequired`: diff --git a/docs/changelog.rst b/docs/changelog.rst index 2ad8faac..4b7ed69d 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -6,6 +6,11 @@ Change Log All library changes, in descending order. +Version 3.2.1 +------------- + +- Updated documentation to reference cookie-parser dependency when using `stormpath.authenticationRequired` middleware + Version 3.2.0 ------------- diff --git a/package.json b/package.json index 38d69267..f0a8c5e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "express-stormpath", - "version": "3.2.0", + "version": "3.2.1", "description": "Build simple, secure web applications with Stormpath and Express!", "keywords": [ "express",