From 3adcd922da3a1b4b4d516836d14e31af234706a3 Mon Sep 17 00:00:00 2001 From: Josh Cunningham Date: Tue, 23 Feb 2021 08:26:52 -0800 Subject: [PATCH] Update README.md (#192) * Update README.md Directly link to a few helpful places in the documentation. * docs: fix authorizationParams example in docs * chore: fix eslintignore for coverage * Add clientSecret env config * PR feedback Co-authored-by: Adam Mcgrath --- .eslintignore | 3 +++ README.md | 2 +- index.d.ts | 19 ++++++++++++++----- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.eslintignore b/.eslintignore index d8f8d469..0422b546 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,4 @@ +CHANGELOG.md +coverage +.nyc_output docs diff --git a/README.md b/README.md index d7009107..b48f04eb 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ With this basic configuration, your application will require authentication for See the [examples](EXAMPLES.md) for route-specific authentication, custom application session handling, requesting and using access tokens for external APIs, and more. -See the [API documentation](https://auth0.github.io/express-openid-connect) for additional configuration possibilities and provided methods. +See the [API documentation](https://auth0.github.io/express-openid-connect) for [additional configuration possibilities](https://auth0.github.io/express-openid-connect/interfaces/configparams.html) and [provided methods](https://auth0.github.io/express-openid-connect/globals.html#attemptsilentlogin). ## A note on error handling diff --git a/index.d.ts b/index.d.ts index 2df3de60..80e58270 100644 --- a/index.d.ts +++ b/index.d.ts @@ -198,13 +198,17 @@ interface LogoutOptions { * Configuration parameters passed to the `auth()` middleware. * * {@link ConfigParams.issuerBaseURL issuerBaseURL}, {@link ConfigParams.baseURL baseURL}, {@link ConfigParams.clientID clientID} - * and {@link ConfigParams.secret secret} are required but can be configured with environmental variables: + * and {@link ConfigParams.secret secret} are required but can be configured with environmental variables. {@link ConfigParams.clientSecret clientSecret} is not required but can also be configured this way. * * ```js + * # Required * ISSUER_BASE_URL=https://YOUR_DOMAIN - * CLIENT_ID=YOUR_CLIENT_ID * BASE_URL=https://YOUR_APPLICATION_ROOT_URL + * CLIENT_ID=YOUR_CLIENT_ID * SECRET=LONG_RANDOM_VALUE + * + * # Not required + * CLIENT_SECRET=YOUR_CLIENT_SECRET * ``` */ interface ConfigParams { @@ -234,8 +238,8 @@ interface ConfigParams { * ```js * { * response_type: 'id_token', - * response_mode: 'form_post, - * scope: openid profile email' + * response_mode: 'form_post', + * scope: 'openid profile email' * } * ``` * @@ -355,7 +359,12 @@ interface ConfigParams { * })) * `` */ - afterCallback?: (req: OpenidRequest, res: OpenidResponse, session: Session, decodedState: {[key: string]: any}) => Promise | Session; + afterCallback?: ( + req: OpenidRequest, + res: OpenidResponse, + session: Session, + decodedState: { [key: string]: any } + ) => Promise | Session; /** * Array value of claims to remove from the ID token before storing the cookie session.