fix refresh cookie settings
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
22075489c2
commit
2a51e0a753
@ -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_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: {
|
refresh_settings: {
|
||||||
// same as settings for allow_access under section 2
|
// 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
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ interface AccessSettings {
|
|||||||
include_refresh_token?: boolean
|
include_refresh_token?: boolean
|
||||||
refresh_token_expires_in?: number
|
refresh_token_expires_in?: number
|
||||||
redirect_to?: string
|
redirect_to?: string
|
||||||
data?: Record<string, unknown>,
|
data?: unknown,
|
||||||
leave_open?: boolean
|
leave_open?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ type Gateway = (
|
|||||||
interface RefreshSettings extends AccessSettings {
|
interface RefreshSettings extends AccessSettings {
|
||||||
leave_open?: never;
|
leave_open?: never;
|
||||||
redirect_to?: never;
|
redirect_to?: never;
|
||||||
|
data?: never;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface GatewayOptions {
|
interface GatewayOptions {
|
||||||
@ -134,7 +135,8 @@ class GatewayClass {
|
|||||||
);
|
);
|
||||||
const refresh_result = await auth_request.allow_access ({
|
const refresh_result = await auth_request.allow_access ({
|
||||||
...this._options.refresh_settings,
|
...this._options.refresh_settings,
|
||||||
leave_open: true
|
data: ver.data,
|
||||||
|
leave_open: true
|
||||||
});
|
});
|
||||||
|
|
||||||
const con = req.connection as unknown as Record<string, unknown>;
|
const con = req.connection as unknown as Record<string, unknown>;
|
||||||
@ -171,5 +173,6 @@ export {
|
|||||||
AnyFunc,
|
AnyFunc,
|
||||||
Gateway,
|
Gateway,
|
||||||
GatewayOptions,
|
GatewayOptions,
|
||||||
GatewayClass
|
GatewayClass,
|
||||||
|
RefreshSettings
|
||||||
};
|
};
|
||||||
|
@ -27,7 +27,8 @@ import create_gateway, {
|
|||||||
GatewayOptions,
|
GatewayOptions,
|
||||||
GatewayClass,
|
GatewayClass,
|
||||||
Gateway,
|
Gateway,
|
||||||
AnyFunc
|
AnyFunc,
|
||||||
|
RefreshSettings
|
||||||
} from './Gateway';
|
} from './Gateway';
|
||||||
import keystore, {
|
import keystore, {
|
||||||
KeyStore, KeyStoreExport,
|
KeyStore, KeyStoreExport,
|
||||||
@ -57,6 +58,7 @@ export {
|
|||||||
GatewayOptions,
|
GatewayOptions,
|
||||||
GatewayClass,
|
GatewayClass,
|
||||||
Gateway,
|
Gateway,
|
||||||
|
RefreshSettings,
|
||||||
AnyFunc,
|
AnyFunc,
|
||||||
KeyStore,
|
KeyStore,
|
||||||
KeyStoreExport,
|
KeyStoreExport,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sapphirecode/auth-server-helper",
|
"name": "@sapphirecode/auth-server-helper",
|
||||||
"version": "2.2.0",
|
"version": "2.2.1",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Timo Hocker",
|
"name": "Timo Hocker",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user