From e6daa9c0d8000b2f0d8de2bc39f59ef4bd871c74 Mon Sep 17 00:00:00 2001 From: kizaonline Date: Thu, 30 May 2024 09:41:04 +1000 Subject: [PATCH 1/2] ON-40845 # Change `custom:groups` to comma seperated string --- src/userService.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/userService.ts b/src/userService.ts index 539016e..3a190b9 100644 --- a/src/userService.ts +++ b/src/userService.ts @@ -77,9 +77,10 @@ export function parseUserProfile( typeof jwtPayload['custom:phone_number_verified'] === 'boolean' ? jwtPayload['custom:phone_number_verified'] : undefined, - groups: Array.isArray(jwtPayload['custom:groups']) - ? jwtPayload['custom:groups'] - : undefined, + groups: + typeof jwtPayload['custom:groups'] === 'string' + ? jwtPayload['custom:groups'].split(',') + : undefined, } if ( From 55517b472f4aa64793dad8af95b7bf2ec7b88475 Mon Sep 17 00:00:00 2001 From: kizaonline Date: Thu, 30 May 2024 09:45:45 +1000 Subject: [PATCH 2/2] Update src/userService.ts Co-authored-by: Ryan Button <56656890+RyanButton@users.noreply.github.com> --- src/userService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/userService.ts b/src/userService.ts index 3a190b9..8d3f1df 100644 --- a/src/userService.ts +++ b/src/userService.ts @@ -79,7 +79,7 @@ export function parseUserProfile( : undefined, groups: typeof jwtPayload['custom:groups'] === 'string' - ? jwtPayload['custom:groups'].split(',') + ? jwtPayload['custom:groups'].split(',').map((group) => group.trim()) : undefined, }