Skip to content

Commit

Permalink
Add back urlencoded
Browse files Browse the repository at this point in the history
  • Loading branch information
joshcanhelp committed Dec 20, 2019
1 parent 7e7fd77 commit 9d273bb
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions articles/quickstart/webapp/express/01-login.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ Your application will need the following packages:
npm install express express-openid-connect express-session
```

### Handling server responses
Your application will need to parse URL-encoded data sent back from the Auth0 server. Express provides a middleware for this called `express.urlencoded`. If you are integrating an existing application that uses `urlencoded` from the `body-parser`module, that will work as well.

```js
const express = require('express');
const app = express();

app.use(express.urlencoded({
extended: false
}));
```

### Configure Router
The Express OpenID Connect library provides the `auth` router in order to attach authentication routes to your application. This router requires session middleware in order to keep the user logged across multiple requests. In this quickstart you will use the `express-session` middleware to support it.

Expand All @@ -50,12 +62,9 @@ You will need to configure the router with the following Auth0 application keys
Here is an example configuration using this router. For additional configuration options visit the [API documentation](https://github.com/auth0/express-openid-connect/blob/master/API.md).

```js
const express = require('express');
const session = require('express-session');
const { auth } = require('express-openid-connect');

const app = express();

app.use(session({
secret: 'use a secure environment variable in production',
resave: true,
Expand Down

0 comments on commit 9d273bb

Please sign in to comment.