Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Update protected route middleware docs #603

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down
5 changes: 5 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down