From 3c3057b6d8cd83d81cb8f10ebdbe119b46fabcc3 Mon Sep 17 00:00:00 2001 From: Francis Chartrand Date: Tue, 13 Feb 2024 10:36:55 -0500 Subject: [PATCH] fix: make expiresAt parser major browsers compatible --- src/domain/Session.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/domain/Session.ts b/src/domain/Session.ts index b415ea91..2681b84b 100644 --- a/src/domain/Session.ts +++ b/src/domain/Session.ts @@ -1,5 +1,6 @@ /* eslint-disable no-nested-ternary */ import { KEYUTIL, KJUR, b64utoutf8 } from 'jsrsasign'; +import moment from 'moment'; import swarmPublicKey from '../pubkey'; import Profile from './Profile'; import Contact from './Contact'; @@ -126,7 +127,7 @@ export default class Session { authorizations, acl: plain.data.acls ? plain.data.acls : plain.data.acl ? plain.data.acl : [], tenantUuid: plain.data.metadata ? plain.data.metadata.tenant_uuid : undefined, - expiresAt: new Date(`${plain.data.utc_expires_at}z`), + expiresAt: moment.utc(plain.data.utc_expires_at).toDate(), stackUuid: plain.data.xivo_uuid, // eslint-disable-next-line stackHostFromHeader: plain._headers?.get?.('wazo-stack-host'),