From 09b938b49f65a06f1d2d1510da8714a290113a67 Mon Sep 17 00:00:00 2001 From: bobrimperator Date: Sat, 28 Dec 2024 20:02:36 +0100 Subject: [PATCH] fix(ember-simple-auth): parse expirationTime before setting it --- packages/ember-simple-auth/src/session-stores/cookie.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/ember-simple-auth/src/session-stores/cookie.ts b/packages/ember-simple-auth/src/session-stores/cookie.ts index 9531b86d9..6c6841882 100644 --- a/packages/ember-simple-auth/src/session-stores/cookie.ts +++ b/packages/ember-simple-auth/src/session-stores/cookie.ts @@ -217,8 +217,9 @@ export default class CookieStore extends BaseStore { this._fastboot = (getOwner(this) as any).lookup('service:fastboot'); let cachedExpirationTime = this._read(`${this.get('cookieName')}-expiration_time`); - if (cachedExpirationTime) { - this.set('cookieExpirationTime', parseInt(cachedExpirationTime as any, 10)); + const parsedExpirationTime = parseInt(cachedExpirationTime, 10); + if (parsedExpirationTime) { + this.set('cookieExpirationTime', parsedExpirationTime); } if (!this.get('_fastboot.isFastBoot')) {