From 0f14b683df0dcf2bbb586ef44ee73f25a3391844 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 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..21fdd75e0 100644 --- a/packages/ember-simple-auth/src/session-stores/cookie.ts +++ b/packages/ember-simple-auth/src/session-stores/cookie.ts @@ -216,9 +216,10 @@ 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 cachedExpirationTime = this._read(`${this.get('cookieName')}-expiration_time`); + const parsedExpirationTime = parseInt(cachedExpirationTime, 10); + if (parsedExpirationTime) { + this.set('cookieExpirationTime', parsedExpirationTime); } if (!this.get('_fastboot.isFastBoot')) {