Skip to content

Commit 50eb198

Browse files
chnaged jwt exp
1 parent af06f64 commit 50eb198

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

packages/service-core/src/routes/endpoints/socket-route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const syncStreamReactive: SocketRouteGenerator = (router) =>
2929
client_id: params.client_id,
3030
user_id: context.user_id!,
3131
user_agent: context.user_agent,
32-
jwt_exp: { exp: context.token_payload?.exp }
32+
jwt_exp: context.token_payload?.exp ? new Date(context.token_payload.exp) : undefined
3333
};
3434

3535
const streamStart = Date.now();

packages/service-core/src/routes/endpoints/sync-stream.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ export const syncStreamed = routeDefinition({
3838
client_id: clientId,
3939
user_id: payload.context.user_id!,
4040
user_agent: userAgent as string,
41-
jwt_exp: {
42-
exp: token_payload?.exp
43-
}
41+
jwt_exp: token_payload?.exp ? new Date(token_payload?.exp) : undefined
4442
};
4543

4644
if (routerEngine.closed) {

packages/types/src/events.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ export enum EmitterEngineEvents {
44
SDK_CONNECT_EVENT = 'sdk-connect-event',
55
SDK_DISCONNECT_EVENT = 'sdk-disconnect-event'
66
}
7-
type JwtExp = {
8-
exp?: number;
9-
};
107

118
export type SubscribeEvents = {
129
[EmitterEngineEvents.SDK_CONNECT_EVENT]: SdkConnectEventData;
@@ -18,7 +15,7 @@ export type SdkUserData = {
1815
client_id?: string;
1916
user_id: string;
2017
user_agent?: string;
21-
jwt_exp: JwtExp;
18+
jwt_exp?: Date;
2219
};
2320

2421
export type SdkConnectEventData = {

0 commit comments

Comments
 (0)