From 9d37bf54ebd3c0440d3c8eaa794ce3b24fdcfd6e Mon Sep 17 00:00:00 2001 From: michaelyons Date: Mon, 24 Jun 2024 12:12:09 -0600 Subject: [PATCH] Add generic Userinfo to createFusionAuth for vue sdk --- .../sdk-vue/src/createFusionAuth/createFusionAuth.test.ts | 6 +++++- packages/sdk-vue/src/createFusionAuth/createFusionAuth.ts | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/sdk-vue/src/createFusionAuth/createFusionAuth.test.ts b/packages/sdk-vue/src/createFusionAuth/createFusionAuth.test.ts index 7821c05..edda499 100644 --- a/packages/sdk-vue/src/createFusionAuth/createFusionAuth.test.ts +++ b/packages/sdk-vue/src/createFusionAuth/createFusionAuth.test.ts @@ -35,7 +35,11 @@ describe('createFusionAuth', () => { }); it('Fetches userInfo', async () => { - const user = { given_name: 'JSON', family_name: 'Bourne' }; + const user = { + given_name: 'JSON', + family_name: 'Bourne', + customTrait: 'additional info', + }; const mockUserInfoResponse = new Response(JSON.stringify(user), { status: 200, }); diff --git a/packages/sdk-vue/src/createFusionAuth/createFusionAuth.ts b/packages/sdk-vue/src/createFusionAuth/createFusionAuth.ts index 8adff80..51cd254 100644 --- a/packages/sdk-vue/src/createFusionAuth/createFusionAuth.ts +++ b/packages/sdk-vue/src/createFusionAuth/createFusionAuth.ts @@ -23,12 +23,12 @@ export const createFusionAuth = (config: FusionAuthConfig): FusionAuth => { const isGettingUserInfo = ref(false); const error = ref(null); - async function getUserInfo() { + async function getUserInfo() { isGettingUserInfo.value = true; error.value = null; try { - userInfo.value = await core.fetchUserInfo(); + userInfo.value = await core.fetchUserInfo(); return userInfo.value; } catch (e) { error.value = e as Error;