From 9b93d5ee02c31f7069b09dc8dec81541701a6aa3 Mon Sep 17 00:00:00 2001 From: Bryan Florkiewicz Date: Thu, 5 Oct 2023 17:57:27 -0400 Subject: [PATCH] Clear cache if URL param for trial present --- src/jwt/user.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/jwt/user.ts b/src/jwt/user.ts index 0a4ef036e..7a9fe5c47 100644 --- a/src/jwt/user.ts +++ b/src/jwt/user.ts @@ -190,11 +190,17 @@ export default async (token: SSOParsedToken): Promise => { if (isITLessCognito) { // cogToken = await getTokenWithAuthorizationCode(); } + const params = new URLSearchParams(getWindow().location.search); + const opts = { + cache: { + override: params.has('trial_activated', 'true'), + }, + }; try { if (user.identity.org_id) { data = isITLessCognito - ? ((await serviceAPI.servicesGet()) as unknown as typeof data) - : ((await serviceAPI.servicesGet()) as unknown as typeof data); + ? ((await serviceAPI.servicesGet(opts)) as unknown as typeof data) + : ((await serviceAPI.servicesGet(opts)) as unknown as typeof data); } else { console.log('Cannot call entitlements API, no account number'); }