diff --git a/README.md b/README.md index f0bb077..74177ca 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ const gateway = create_gateway({ refresh_cookie_name: 'refresh_cookie', // if defined, refresh tokens will be read and used to automatically refresh client tokens (requires the refresh_settings attribute) refresh_settings: { // same as settings for allow_access under section 2 - // the options redirect_to and leave_open are not supported here + // the options data, redirect_to and leave_open are not supported here } }); diff --git a/lib/AuthHandler.ts b/lib/AuthHandler.ts index 04a4836..055464b 100644 --- a/lib/AuthHandler.ts +++ b/lib/AuthHandler.ts @@ -14,7 +14,7 @@ interface AccessSettings { include_refresh_token?: boolean refresh_token_expires_in?: number redirect_to?: string - data?: Record, + data?: unknown, leave_open?: boolean } diff --git a/lib/Gateway.ts b/lib/Gateway.ts index 505c28d..b544011 100644 --- a/lib/Gateway.ts +++ b/lib/Gateway.ts @@ -19,6 +19,7 @@ type Gateway = ( interface RefreshSettings extends AccessSettings { leave_open?: never; redirect_to?: never; + data?: never; } interface GatewayOptions { @@ -134,7 +135,8 @@ class GatewayClass { ); const refresh_result = await auth_request.allow_access ({ ...this._options.refresh_settings, - leave_open: true + data: ver.data, + leave_open: true }); const con = req.connection as unknown as Record; @@ -171,5 +173,6 @@ export { AnyFunc, Gateway, GatewayOptions, - GatewayClass + GatewayClass, + RefreshSettings }; diff --git a/lib/index.ts b/lib/index.ts index 19bcf04..ea798e1 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -27,7 +27,8 @@ import create_gateway, { GatewayOptions, GatewayClass, Gateway, - AnyFunc + AnyFunc, + RefreshSettings } from './Gateway'; import keystore, { KeyStore, KeyStoreExport, @@ -57,6 +58,7 @@ export { GatewayOptions, GatewayClass, Gateway, + RefreshSettings, AnyFunc, KeyStore, KeyStoreExport, diff --git a/package.json b/package.json index 4811f66..fe30be7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sapphirecode/auth-server-helper", - "version": "2.2.0", + "version": "2.2.1", "main": "dist/index.js", "author": { "name": "Timo Hocker",