fix refresh data carrying
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
84be087743
commit
122bd7b574
@ -139,7 +139,7 @@ class GatewayClass {
|
|||||||
const con = req.connection as unknown as Record<string, unknown>;
|
const con = req.connection as unknown as Record<string, unknown>;
|
||||||
con.auth = {
|
con.auth = {
|
||||||
token_id: refresh_result.access_token_id,
|
token_id: refresh_result.access_token_id,
|
||||||
token_data: this._options.refresh_settings.data
|
token_data: ver.data
|
||||||
};
|
};
|
||||||
|
|
||||||
logger ('tokens refreshed');
|
logger ('tokens refreshed');
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@sapphirecode/auth-server-helper",
|
"name": "@sapphirecode/auth-server-helper",
|
||||||
"version": "3.2.0",
|
"version": "3.2.1",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Timo Hocker",
|
"name": "Timo Hocker",
|
||||||
|
@ -81,8 +81,12 @@ describe ('gateway', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it ('should automatically return new tokens', async () => {
|
it ('should automatically return new tokens', async () => {
|
||||||
const token = await authority.sign ('access_token', 60);
|
const token = await authority.sign ('access_token', 60, { data: 'foobar' });
|
||||||
const refresh = await authority.sign ('refresh_token', 3600);
|
const refresh = await authority.sign (
|
||||||
|
'refresh_token',
|
||||||
|
3600,
|
||||||
|
{ data: 'foobar' }
|
||||||
|
);
|
||||||
jasmine.clock ()
|
jasmine.clock ()
|
||||||
.tick (70000);
|
.tick (70000);
|
||||||
const resp = await get (
|
const resp = await get (
|
||||||
@ -94,6 +98,8 @@ describe ('gateway', () => {
|
|||||||
expect (JSON.parse (resp.body as string).token_id)
|
expect (JSON.parse (resp.body as string).token_id)
|
||||||
.not
|
.not
|
||||||
.toEqual (token.id);
|
.toEqual (token.id);
|
||||||
|
expect (JSON.parse (resp.body as string).token_data)
|
||||||
|
.toEqual ('foobar');
|
||||||
});
|
});
|
||||||
|
|
||||||
it ('should correctly deliver token data', async () => {
|
it ('should correctly deliver token data', async () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user