@auth0/auth0-express 1.0.0-beta.5 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,9 +1,5 @@
1
1
  The Auth0 Express SDK is a library for implementing user authentication in Express applications.
2
2
 
3
- > :warning: Please be aware that auth0-express is currently in [**Beta**](https://auth0.com/docs/troubleshoot/product-lifecycle/product-release-stages). Whilst we encourage you to test the update within your applications, we do not recommend using this version in production yet.
4
- > As with any beta release, we look forward to your questions and feedback to help us improve the library.
5
-
6
- ![Stage: Beta Release](https://img.shields.io/badge/stage-beta-yellow)
7
3
  ![Release](https://img.shields.io/npm/v/@auth0/auth0-express)
8
4
  ![Downloads](https://img.shields.io/npm/dw/@auth0/auth0-express)
9
5
  [![License](https://img.shields.io/badge/license-Apache%20License%202.0-blue)](https://opensource.org/license/apache-2-0)
@@ -43,7 +39,7 @@ Jump straight to the capability you need.
43
39
  ### 1. Install the SDK
44
40
 
45
41
  ```shell
46
- npm i @auth0/auth0-express@beta
42
+ npm i @auth0/auth0-express
47
43
  ```
48
44
 
49
45
  This library requires Node.js 22 LTS and newer LTS versions.
@@ -243,6 +239,20 @@ const accessTokenResult = await req.auth0.client.getAccessToken();
243
239
  console.log(accessTokenResult.accessToken);
244
240
  ```
245
241
 
242
+ ## Error Handling
243
+
244
+ The browser-facing auth routes (login, callback, and logout) forward failures to Express via `next(error)` rather than writing error detail to the response themselves. Before doing so, the SDK replaces the underlying error with a sanitized one that carries only a generic message and a fixed `500` status. This has two effects:
245
+
246
+ - No internal detail (an OAuth `error_description`, a token-endpoint failure reason, stack traces, file paths) reaches the client, regardless of `NODE_ENV`. The original error is preserved on `error.cause`, so your own logging can still inspect it.
247
+ - The failure status is a stable `500` instead of mirroring whatever status an upstream call happened to return (for example a `400` from the token endpoint).
248
+
249
+ Express still produces the final response. Its built-in error handler writes the (now generic) error stack into the response body unless `NODE_ENV` is set to `production`. For full control over what clients see, you can:
250
+
251
+ - Run your app with `NODE_ENV=production` in any deployed environment, and/or
252
+ - Mount your own [Express error-handling middleware](https://expressjs.com/en/guide/error-handling.html) after the Auth0 router. Read `error.cause` there if you want to log the original failure.
253
+
254
+ The back-channel logout route is different: it is called server-to-server by Auth0, not by a browser, so the SDK owns its response directly and always replies with the status codes required by the [OpenID Connect Back-Channel Logout](https://openid.net/specs/openid-connect-backchannel-1_0.html) spec (a success status, which the SDK returns as `204` and the spec also allows as `200`, or `400` on failure) without internal detail in the body. The route reads the `application/x-www-form-urlencoded` body that Auth0 sends itself, so you do not need to mount a body parser for it, and a body that a parser of yours has already read is left as it is. A parser that you mounted before the Auth0 router can still refuse a request first, and that goes to your error handler. Apart from that, the route does **not** flow through your error-handling middleware. If you need to log or customize back-channel logout failures, mount your own route and call `req.auth0.client.handleBackchannelLogout(logoutToken)` directly. A route of your own does not get the body parsing, so mount `express.urlencoded({ extended: false })` on it.
255
+
246
256
  ## Feedback
247
257
 
248
258
  ### Contributing
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Normalizes an error thrown by a browser-facing auth handler (login, callback,
3
+ * logout) into a sanitized error before it is handed to Express via `next()`.
4
+ *
5
+ * This solves two problems at once:
6
+ *
7
+ * 1. No internal detail leaks to the client. The browser-facing handlers
8
+ * delegate to Express's error pipeline, and Express's default handler
9
+ * (finalhandler) writes `err.stack` into the response body whenever the app
10
+ * is not running with `NODE_ENV=production`. By replacing the original error
11
+ * with one that carries only a generic message, that body can never contain
12
+ * an OAuth `error_description`, a token-endpoint failure reason, or any other
13
+ * internal detail, regardless of `NODE_ENV`. The original error is preserved
14
+ * on `cause` (which finalhandler never serializes into the body) so an
15
+ * application's own error-handling middleware can still log it server-side.
16
+ *
17
+ * 2. The client-facing status stays stable. finalhandler derives the HTTP
18
+ * status from `err.status`/`err.statusCode`. The underlying client attaches
19
+ * the upstream HTTP status to some failures, so a failed code exchange would
20
+ * otherwise surface to the browser as the token endpoint's `400` rather than
21
+ * a `500`. Pinning the status to `500` keeps the callback/login/logout
22
+ * failure contract independent of whatever status an upstream call returned.
23
+ */
24
+ export declare function sanitizeHandlerError(cause: unknown): Error;
25
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,CAI1D"}
package/dist/errors.js ADDED
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Normalizes an error thrown by a browser-facing auth handler (login, callback,
3
+ * logout) into a sanitized error before it is handed to Express via `next()`.
4
+ *
5
+ * This solves two problems at once:
6
+ *
7
+ * 1. No internal detail leaks to the client. The browser-facing handlers
8
+ * delegate to Express's error pipeline, and Express's default handler
9
+ * (finalhandler) writes `err.stack` into the response body whenever the app
10
+ * is not running with `NODE_ENV=production`. By replacing the original error
11
+ * with one that carries only a generic message, that body can never contain
12
+ * an OAuth `error_description`, a token-endpoint failure reason, or any other
13
+ * internal detail, regardless of `NODE_ENV`. The original error is preserved
14
+ * on `cause` (which finalhandler never serializes into the body) so an
15
+ * application's own error-handling middleware can still log it server-side.
16
+ *
17
+ * 2. The client-facing status stays stable. finalhandler derives the HTTP
18
+ * status from `err.status`/`err.statusCode`. The underlying client attaches
19
+ * the upstream HTTP status to some failures, so a failed code exchange would
20
+ * otherwise surface to the browser as the token endpoint's `400` rather than
21
+ * a `500`. Pinning the status to `500` keeps the callback/login/logout
22
+ * failure contract independent of whatever status an upstream call returned.
23
+ */
24
+ export function sanitizeHandlerError(cause) {
25
+ const error = new Error('Authentication request could not be completed.', { cause });
26
+ error.status = 500;
27
+ return error;
28
+ }
29
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,gDAAgD,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACpF,KAAqC,CAAC,MAAM,GAAG,GAAG,CAAC;IACpD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,3 +1,14 @@
1
- import { Request, Response } from 'express';
1
+ import { NextFunction, Request, Response } from 'express';
2
+ /**
3
+ * Reads the body of a back-channel logout request. Auth0 sends the `logout_token` as `application/x-www-form-urlencoded`
4
+ * (OpenID Connect Back-Channel Logout, section 2.5), and the router mounts no body parser for the app, so the route
5
+ * parses the form itself. A parser that the app mounted earlier has already read the body, and this one leaves it as it
6
+ * is. A body that cannot be read is answered as any other failure here, with a bare `400`.
7
+ */
8
+ export declare function parseBackchannelLogoutBody(req: Request, res: Response, next: NextFunction): void;
9
+ /**
10
+ * Passes the `logout_token` of a back-channel logout request to the client, and answers `204`. Any failure is answered
11
+ * with a bare `400`, and the returned promise never rejects.
12
+ */
2
13
  export declare function handleBackchannelLogout(req: Request, res: Response): Promise<void>;
3
14
  //# sourceMappingURL=backchannel-logout-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"backchannel-logout-handler.d.ts","sourceRoot":"","sources":["../../src/handlers/backchannel-logout-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE5C,wBAAsB,uBAAuB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAcxF"}
1
+ {"version":3,"file":"backchannel-logout-handler.d.ts","sourceRoot":"","sources":["../../src/handlers/backchannel-logout-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAc,MAAM,SAAS,CAAC;AAItE;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,CAgBhG;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBxF"}
@@ -1,15 +1,46 @@
1
- export async function handleBackchannelLogout(req, res) {
2
- const logoutToken = req.body.logout_token;
3
- if (!logoutToken) {
4
- res.status(400).send('Missing `logout_token` in the request body.');
1
+ import { urlencoded } from 'express';
2
+ const parseForm = urlencoded({ extended: false });
3
+ /**
4
+ * Reads the body of a back-channel logout request. Auth0 sends the `logout_token` as `application/x-www-form-urlencoded`
5
+ * (OpenID Connect Back-Channel Logout, section 2.5), and the router mounts no body parser for the app, so the route
6
+ * parses the form itself. A parser that the app mounted earlier has already read the body, and this one leaves it as it
7
+ * is. A body that cannot be read is answered as any other failure here, with a bare `400`.
8
+ */
9
+ export function parseBackchannelLogoutBody(req, res, next) {
10
+ // A body that something else has already read cannot be read again. The body parser of Express 5 sees this, but the one
11
+ // of Express 4 only knows the bodies that it read itself, and it would refuse this one with an error.
12
+ if (req.readableEnded) {
13
+ next();
5
14
  return;
6
15
  }
16
+ parseForm(req, res, (error) => {
17
+ if (error) {
18
+ res.status(400).send();
19
+ return;
20
+ }
21
+ next();
22
+ });
23
+ }
24
+ /**
25
+ * Passes the `logout_token` of a back-channel logout request to the client, and answers `204`. Any failure is answered
26
+ * with a bare `400`, and the returned promise never rejects.
27
+ */
28
+ export async function handleBackchannelLogout(req, res) {
29
+ // Express 4 does not catch a promise that a handler rejects, and that ends the process, so every failure is answered
30
+ // here and the promise never rejects.
7
31
  try {
32
+ const logoutToken = req.body?.logout_token;
33
+ if (!logoutToken) {
34
+ res.status(400).send('Missing `logout_token` in the request body.');
35
+ return;
36
+ }
8
37
  await req.auth0.client.handleBackchannelLogout(logoutToken);
9
38
  res.status(204).send(null);
10
39
  }
11
- catch (e) {
12
- res.status(400).send(e.message);
40
+ catch {
41
+ if (!res.headersSent) {
42
+ res.status(400).send();
43
+ }
13
44
  }
14
45
  }
15
46
  //# sourceMappingURL=backchannel-logout-handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"backchannel-logout-handler.js","sourceRoot":"","sources":["../../src/handlers/backchannel-logout-handler.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,GAAY,EAAE,GAAa;IACvE,MAAM,WAAW,GAAG,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC;IAE1C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;QACpE,OAAO;IACT,CAAC;IAED,IAAI,CAAC;QACH,MAAM,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;QAC5D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAE,CAAW,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"backchannel-logout-handler.js","sourceRoot":"","sources":["../../src/handlers/backchannel-logout-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,UAAU,EAAE,MAAM,SAAS,CAAC;AAEtE,MAAM,SAAS,GAAG,UAAU,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;AAElD;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,GAAY,EAAE,GAAa,EAAE,IAAkB;IACxF,wHAAwH;IACxH,sGAAsG;IACtG,IAAI,GAAG,CAAC,aAAa,EAAE,CAAC;QACtB,IAAI,EAAE,CAAC;QACP,OAAO;IACT,CAAC;IAED,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,KAAe,EAAE,EAAE;QACtC,IAAI,KAAK,EAAE,CAAC;YACV,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;YACvB,OAAO;QACT,CAAC;QAED,IAAI,EAAE,CAAC;IACT,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,GAAY,EAAE,GAAa;IACvE,qHAAqH;IACrH,sCAAsC;IACtC,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC;QAE3C,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;YACpE,OAAO;QACT,CAAC;QAED,MAAM,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;QAC5D,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;YACrB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QACzB,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Request, Response } from 'express';
1
+ import { Request, Response, NextFunction } from 'express';
2
2
  import { Auth0Options } from '../types.js';
3
- export declare function handleCallback(req: Request, res: Response, options: Auth0Options): Promise<void>;
3
+ export declare function handleCallback(req: Request, res: Response, options: Auth0Options, next: NextFunction): Promise<void>;
4
4
  //# sourceMappingURL=callback-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"callback-handler.d.ts","sourceRoot":"","sources":["../../src/handlers/callback-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAG5C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,wBAAsB,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAiCtG"}
1
+ {"version":3,"file":"callback-handler.d.ts","sourceRoot":"","sources":["../../src/handlers/callback-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI1D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,wBAAsB,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B1H"}
@@ -1,6 +1,7 @@
1
1
  import { createRouteUrl } from '../utils.js';
2
2
  import { resolveAppBaseUrl } from '../app-base-url.js';
3
- export async function handleCallback(req, res, options) {
3
+ import { sanitizeHandlerError } from '../errors.js';
4
+ export async function handleCallback(req, res, options, next) {
4
5
  try {
5
6
  const appBaseUrl = resolveAppBaseUrl(options.appBaseUrl, req);
6
7
  if (options.enterpriseConnect) {
@@ -18,13 +19,8 @@ export async function handleCallback(req, res, options) {
18
19
  const { appState } = await req.auth0.client.completeInteractiveLogin(createRouteUrl(req.url, appBaseUrl));
19
20
  res.redirect(appState?.returnTo ?? appBaseUrl);
20
21
  }
21
- catch (e) {
22
- /* eslint-disable @typescript-eslint/no-explicit-any */
23
- const error = e;
24
- res.status(500).json({
25
- error: error.cause?.error || error.name,
26
- message: error.cause?.error_description || error.message,
27
- });
22
+ catch (error) {
23
+ next(sanitizeHandlerError(error));
28
24
  }
29
25
  }
30
26
  //# sourceMappingURL=callback-handler.js.map
@@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AAO,EAAE,iDAAiD,EAAE,CAAC,CAAC;YACvH,CAAC;YACD,OAAO;QACT,CAAC;QAED,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,wBAAwB,CAClE,cAAc,CAAC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CACpC,CAAC;QAEF,GAAG,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,IAAI,UAAU,CAAC,CAAC;IACjD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC;IACpC,CAAC;AACH,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Request, Response } from 'express';
1
+ import { Request, Response, NextFunction } from 'express';
2
2
  import { Auth0Options } from '../index.js';
3
- export declare function handleLogin(req: Request, res: Response, options: Auth0Options): Promise<void>;
3
+ export declare function handleLogin(req: Request, res: Response, options: Auth0Options, next: NextFunction): Promise<void>;
4
4
  //# sourceMappingURL=login-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"login-handler.d.ts","sourceRoot":"","sources":["../../src/handlers/login-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAG5C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA+D3C,wBAAsB,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BnG"}
1
+ {"version":3,"file":"login-handler.d.ts","sourceRoot":"","sources":["../../src/handlers/login-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI1D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA+D3C,wBAAsB,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBvH"}
@@ -1,5 +1,6 @@
1
1
  import { createRouteUrl, toSafeRedirect } from '../utils.js';
2
2
  import { resolveAppBaseUrl } from '../app-base-url.js';
3
+ import { sanitizeHandlerError } from '../errors.js';
3
4
  // Block both Object.prototype own-property names and commonly abused
4
5
  // prototype-pollution keys that are not own-properties of Object.prototype.
5
6
  const DENIED_KEYS = new Set([
@@ -55,7 +56,7 @@ function filterAuthorizationParams(params, disallowed) {
55
56
  }
56
57
  return Object.keys(filtered).length > 0 ? filtered : undefined;
57
58
  }
58
- export async function handleLogin(req, res, options) {
59
+ export async function handleLogin(req, res, options, next) {
59
60
  try {
60
61
  const appBaseUrl = resolveAppBaseUrl(options.appBaseUrl, req);
61
62
  const callbackPath = options.routes?.callback ?? '/auth/callback';
@@ -74,10 +75,7 @@ export async function handleLogin(req, res, options) {
74
75
  res.redirect(authorizationUrl.href);
75
76
  }
76
77
  catch (error) {
77
- res.status(500).json({
78
- error: error.name,
79
- message: error.message,
80
- });
78
+ next(sanitizeHandlerError(error));
81
79
  }
82
80
  }
83
81
  //# sourceMappingURL=login-handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"login-handler.js","sourceRoot":"","sources":["../../src/handlers/login-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAGvD,qEAAqE;AACrE,4EAA4E;AAC5E,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC;IAC1B,GAAG,MAAM,CAAC,mBAAmB,CAAC,MAAM,CAAC,SAAS,CAAC;IAC/C,WAAW;IACX,aAAa;IACb,WAAW;CACZ,CAAC,CAAC;AAEH,gFAAgF;AAChF,MAAM,qBAAqB,GAAG,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AAC;QACH,MAAM,UAAU,GAAG,iBAAiB,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;QAC9D,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,QAAQ,IAAI,gBAAgB,CAAC;QAClE,MAAM,WAAW,GAAG,cAAc,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QAE7D,MAAM,KAAK,GAAG,GAAG,CAAC,KAAgC,CAAC;QACnD,MAAM,iBAAiB,GAAG,KAAK,CAAC,QAA8B,CAAC;QAC/D,MAAM,iBAAiB,GAAG,cAAc,CAAC,iBAAiB,IAAI,GAAG,EAAE,UAAU,CAAC,CAAC;QAE/E,MAAM,gBAAgB,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,qBAAqB,CAAC;YACpE,2BAA2B,EAAE,OAAO,CAAC,2BAA2B;YAChE,QAAQ,EAAE,EAAE,QAAQ,EAAE,iBAAiB,EAAE;YACzC,mBAAmB,EAAE;gBACnB,GAAG,yBAAyB,CAAC,KAAK,EAAE,CAAC,UAAU,CAAC,CAAC;gBACjD,YAAY,EAAE,WAAW,CAAC,QAAQ,EAAE;aACrC;SACF,CAAC,CAAC;QAEH,GAAG,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC;IACpC,CAAC;AACH,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Request, Response } from 'express';
1
+ import { Request, Response, NextFunction } from 'express';
2
2
  import { Auth0Options } from '../types.js';
3
- export declare function handleLogout(req: Request, res: Response, options: Auth0Options): Promise<void>;
3
+ export declare function handleLogout(req: Request, res: Response, options: Auth0Options, next: NextFunction): Promise<void>;
4
4
  //# sourceMappingURL=logout-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logout-handler.d.ts","sourceRoot":"","sources":["../../src/handlers/logout-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,wBAAsB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBpG"}
1
+ {"version":3,"file":"logout-handler.d.ts","sourceRoot":"","sources":["../../src/handlers/logout-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG1D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,wBAAsB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBxH"}
@@ -1,5 +1,6 @@
1
1
  import { resolveAppBaseUrl } from '../app-base-url.js';
2
- export async function handleLogout(req, res, options) {
2
+ import { sanitizeHandlerError } from '../errors.js';
3
+ export async function handleLogout(req, res, options, next) {
3
4
  try {
4
5
  const returnTo = resolveAppBaseUrl(options.appBaseUrl, req);
5
6
  // In Enterprise Connect mode the mounted route always forces a federated
@@ -13,10 +14,7 @@ export async function handleLogout(req, res, options) {
13
14
  res.redirect(logoutUrl.href);
14
15
  }
15
16
  catch (error) {
16
- res.status(500).json({
17
- error: error.name,
18
- message: error.message,
19
- });
17
+ next(sanitizeHandlerError(error));
20
18
  }
21
19
  }
22
20
  //# sourceMappingURL=logout-handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logout-handler.js","sourceRoot":"","sources":["../../src/handlers/logout-handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAGvD,MAAM,CAAC,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,GACb,OAAO,CAAC,iBAAiB,IAAI,GAAG,CAAC,KAAK,CAAC,SAAS,KAAK,MAAM;YACzD,CAAC,CAAC,EAAE,SAAS,EAAE,IAAa,EAAE;YAC9B,CAAC,CAAC,EAAE,CAAC;QAET,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;QAE5E,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC;IACpC,CAAC;AACH,CAAC"}
package/dist/router.js CHANGED
@@ -4,7 +4,7 @@ import { createServerClientInstance } from './utils.js';
4
4
  import { handleLogin } from './handlers/login-handler.js';
5
5
  import { handleCallback } from './handlers/callback-handler.js';
6
6
  import { handleLogout } from './handlers/logout-handler.js';
7
- import { handleBackchannelLogout } from './handlers/backchannel-logout-handler.js';
7
+ import { handleBackchannelLogout, parseBackchannelLogoutBody } from './handlers/backchannel-logout-handler.js';
8
8
  import { runWithContext } from './store/request-context.js';
9
9
  import { getConfig } from './config.js';
10
10
  import './types/express.js';
@@ -66,10 +66,10 @@ export function createAuth0(opts = {}) {
66
66
  logout: options.routes?.logout ?? '/auth/logout',
67
67
  backchannelLogout: options.routes?.backchannelLogout ?? '/auth/backchannel-logout',
68
68
  };
69
- router.get(routes.login, (req, res) => handleLogin(req, res, options));
70
- router.get(routes.callback, (req, res) => handleCallback(req, res, options));
71
- router.get(routes.logout, (req, res) => handleLogout(req, res, options));
72
- router.post(routes.backchannelLogout, (req, res) => handleBackchannelLogout(req, res));
69
+ router.get(routes.login, (req, res, next) => handleLogin(req, res, options, next));
70
+ router.get(routes.callback, (req, res, next) => handleCallback(req, res, options, next));
71
+ router.get(routes.logout, (req, res, next) => handleLogout(req, res, options, next));
72
+ router.post(routes.backchannelLogout, parseBackchannelLogoutBody, (req, res) => handleBackchannelLogout(req, res));
73
73
  }
74
74
  return router;
75
75
  }
@@ -1 +1 @@
1
- {"version":3,"file":"router.js","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAmC,MAAM,SAAS,CAAC;AAClE,OAAO,YAAY,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,WAAW,CAAC,OAA8B,EAAE;IAC1D,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC;IAExB,iBAAiB;IACjB,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC;IAE3B,gEAAgE;IAChE,MAAM,CAAC,GAAG,CAAC,CAAC,OAAgB,EAAE,QAAkB,EAAE,IAAkB,EAAE,EAAE;QACtE,cAAc,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,yBAAyB;IACzB,MAAM,WAAW,GAAG,0BAA0B,CAAC,OAAO,CAAC,CAAC;IAExD,oBAAoB;IACpB,MAAM,CAAC,GAAG,CAAC,CAAC,GAA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nF,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;QACzF,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;QACrF,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE,0BAA0B,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACrH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auth0/auth0-express",
3
- "version": "1.0.0-beta.5",
3
+ "version": "1.0.1",
4
4
  "description": "Auth0 Authentication SDK for Express Applications on JavaScript runtimes",
5
5
  "author": "Auth0",
6
6
  "license": "Apache-2.0",
@@ -14,6 +14,7 @@
14
14
  "clean": "rm -rf ./dist",
15
15
  "lint": "eslint \"./**/*.ts*\"",
16
16
  "test": "vitest run",
17
+ "test:express4": "vitest run --config vitest.express4.config.ts",
17
18
  "test:ci": "vitest --watch false --coverage"
18
19
  },
19
20
  "types": "./dist/index.d.ts",