From bed666e68248b2adb775a9c2df9feeb09a287a5d Mon Sep 17 00:00:00 2001 From: frontegg Date: Wed, 28 Feb 2024 18:34:26 +0000 Subject: [PATCH 1/9] chore(release): publish 3.0.20 --- CHANGELOG.md | 10 ++++++++++ lerna.json | 2 +- packages/demo-saas/package.json | 4 ++-- packages/example/package.json | 2 +- packages/nuxt/package.json | 4 ++-- packages/sanity-check/package.json | 2 +- packages/vue/package.json | 2 +- packages/vue/src/sdkVersion.ts | 2 +- 8 files changed, 19 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fefd436..0ba43576 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +# Change Log + +## [3.0.20](https://github.com/frontegg/frontegg-vue/compare/v3.0.19...v3.0.20) (2024-2-28) + +- FR-15376 - fixed null group description exception + +- FR-15305 - Fixed changed fields sent on edit group to support SCIM group update +- FR-15219 - Fixed missing row actions in users table when using MSP + + # Change Log ## [3.0.19](https://github.com/frontegg/frontegg-vue/compare/v3.0.18...v3.0.19) (2024-2-8) diff --git a/lerna.json b/lerna.json index a7d56890..8222c13a 100755 --- a/lerna.json +++ b/lerna.json @@ -2,7 +2,7 @@ "packages": [ "packages/*" ], - "version": "3.0.19", + "version": "3.0.20", "npmClient": "yarn", "useWorkspaces": true, "publishConfig": { diff --git a/packages/demo-saas/package.json b/packages/demo-saas/package.json index ba0259fd..457eb693 100644 --- a/packages/demo-saas/package.json +++ b/packages/demo-saas/package.json @@ -1,6 +1,6 @@ { "name": "vue-demo-saas", - "version": "3.0.19", + "version": "3.0.20", "private": true, "scripts": { "serve": "vue-cli-service serve", @@ -8,7 +8,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { - "@frontegg/vue": "^3.0.19", + "@frontegg/vue": "^3.0.20", "vue": "^2.6.11", "vue-router": "^3.2.0" }, diff --git a/packages/example/package.json b/packages/example/package.json index 3f76ce0e..14343b99 100644 --- a/packages/example/package.json +++ b/packages/example/package.json @@ -1,6 +1,6 @@ { "name": "example-v3", - "version": "3.0.19", + "version": "3.0.20", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index 6275030e..ca0aeb35 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -1,6 +1,6 @@ { "name": "@frontegg/nuxt", - "version": "3.0.19", + "version": "3.0.20", "description": "", "main": "lib/module.js", "types": "types/index.d.ts", @@ -8,6 +8,6 @@ "lib" ], "dependencies": { - "@frontegg/vue": "^3.0.19" + "@frontegg/vue": "^3.0.20" } } diff --git a/packages/sanity-check/package.json b/packages/sanity-check/package.json index a39ddfdf..795548aa 100644 --- a/packages/sanity-check/package.json +++ b/packages/sanity-check/package.json @@ -1,7 +1,7 @@ { "name": "frontegg-angular-sanity-check", "private": true, - "version": "3.0.19", + "version": "3.0.20", "scripts": { "build": "docker-compose build test", "build:dev": "docker-compose build test --no-cache", diff --git a/packages/vue/package.json b/packages/vue/package.json index 50dc2a18..cd4e59a8 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@frontegg/vue", - "version": "3.0.19", + "version": "3.0.20", "description": "", "main": "dist/index.ssr.js", "browser": "dist/index.js", diff --git a/packages/vue/src/sdkVersion.ts b/packages/vue/src/sdkVersion.ts index 4b29c738..11b671c3 100644 --- a/packages/vue/src/sdkVersion.ts +++ b/packages/vue/src/sdkVersion.ts @@ -1 +1 @@ -export default { version: '3.0.19' }; +export default { version: '3.0.20' }; From b11ca69dce77eb4c2bee2d93227e723d425a24ea Mon Sep 17 00:00:00 2001 From: TomerFrontegg <78534155+TomerFrontegg@users.noreply.github.com> Date: Wed, 28 Feb 2024 20:41:27 +0200 Subject: [PATCH 2/9] Update CHANGELOG.md --- CHANGELOG.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ba43576..e51918d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,12 @@ -# Change Log - -## [3.0.20](https://github.com/frontegg/frontegg-vue/compare/v3.0.19...v3.0.20) (2024-2-28) - +# Change Log + +## [3.0.20](https://github.com/frontegg/frontegg-vue/compare/v3.0.19...v3.0.20) (2024-2-28) + - FR-15376 - fixed null group description exception - -- FR-15305 - Fixed changed fields sent on edit group to support SCIM group update -- FR-15219 - Fixed missing row actions in users table when using MSP - - +- FR-15305 - Fixed changed fields sent on edit group to support SCIM group update +- FR-15219 - Fixed missing row actions in users table when using MSP + + # Change Log ## [3.0.19](https://github.com/frontegg/frontegg-vue/compare/v3.0.18...v3.0.19) (2024-2-8) From a684a8bf9499f6946bbae7565a332fdf0119c8c0 Mon Sep 17 00:00:00 2001 From: TomerFrontegg Date: Sun, 3 Mar 2024 14:33:30 +0200 Subject: [PATCH 3/9] FR-15396: support vue router 4 basename --- packages/vue/src/helpers.ts | 12 +++++++++++- packages/vue/src/index.ts | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/vue/src/helpers.ts b/packages/vue/src/helpers.ts index 5e0ab180..e3b32578 100644 --- a/packages/vue/src/helpers.ts +++ b/packages/vue/src/helpers.ts @@ -8,7 +8,7 @@ import { StoreHolder } from './StoreHolder'; import * as Vue from 'vue'; export const setupOnRedirectTo = (router: VueRouter, routes?: Partial) => { - const baseName = router.options.base || ''; + const baseName = getRouterBaseName(router) || ''; StoreHolder.setBasename(baseName); const onRedirectTo = (_path: string, opts?: RedirectOptions) => { let path = _path; @@ -109,3 +109,13 @@ export const simpleMappers = (subState: string, props: any, getter: any) => func return slices.reduce((result, prop) => Object.assign({}, result, { [prop]: getter(prop)(state) }), {}); }; + + +/** + * vue-router base name was changed in v4 from `base` to `history.base` + * @param router VueRouter v3 or v4 + * @returns router base name + */ +export const getRouterBaseName = (router?: VueRouter): string | undefined => { + return router?.options.base || (router?.options as any).history?.base +} \ No newline at end of file diff --git a/packages/vue/src/index.ts b/packages/vue/src/index.ts index 55d67cbf..3c5d58b2 100644 --- a/packages/vue/src/index.ts +++ b/packages/vue/src/index.ts @@ -2,7 +2,7 @@ import _Vue, { PluginObject, reactive, ref } from 'vue'; import { PluginOptions } from './interfaces'; import { User } from '@frontegg/redux-store'; -import { setupOnRedirectTo, syncStateWithComponent } from './helpers'; +import { getRouterBaseName, setupOnRedirectTo, syncStateWithComponent } from './helpers'; import { getStoreBinding, loadingUnsubscribe, @@ -105,7 +105,7 @@ const Frontegg: PluginObject | any = { fronteggApp = initialize({ ...rest, onRedirectTo, - basename: router?.options.base, + basename: getRouterBaseName(router), } as any); const store = fronteggApp.store; From ec50db2bc4ff047ab191092fc1c41f790a0f8924 Mon Sep 17 00:00:00 2001 From: TomerFrontegg <78534155+TomerFrontegg@users.noreply.github.com> Date: Sun, 3 Mar 2024 16:26:57 +0200 Subject: [PATCH 4/9] Update packages/vue/src/helpers.ts Co-authored-by: Yuval Lotem <106734943+yuvalotem1@users.noreply.github.com> --- packages/vue/src/helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vue/src/helpers.ts b/packages/vue/src/helpers.ts index e3b32578..f60da7eb 100644 --- a/packages/vue/src/helpers.ts +++ b/packages/vue/src/helpers.ts @@ -117,5 +117,5 @@ export const simpleMappers = (subState: string, props: any, getter: any) => func * @returns router base name */ export const getRouterBaseName = (router?: VueRouter): string | undefined => { - return router?.options.base || (router?.options as any).history?.base + return router?.options.base ?? (router?.options as any).history?.base } \ No newline at end of file From 7264b953c2bf63012726bde45aa65f4dc3fde927 Mon Sep 17 00:00:00 2001 From: frontegg Date: Sun, 3 Mar 2024 15:51:09 +0000 Subject: [PATCH 5/9] chore(release): publish 3.0.21 --- CHANGELOG.md | 10 ++++++++++ lerna.json | 2 +- packages/demo-saas/package.json | 4 ++-- packages/example/package.json | 2 +- packages/nuxt/package.json | 4 ++-- packages/sanity-check/package.json | 2 +- packages/vue/package.json | 2 +- packages/vue/src/sdkVersion.ts | 2 +- 8 files changed, 19 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e51918d4..cf77d23c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +# Change Log + +## [3.0.21](https://github.com/frontegg/frontegg-vue/compare/v3.0.20...v3.0.21) (2024-3-3) + +- FR-15270 - Added new roles page to the Admin Portal +- FR-15395 - Fixed tab tenant not cleared after logout + +- FR-15376 - fixed null group description exception + + # Change Log ## [3.0.20](https://github.com/frontegg/frontegg-vue/compare/v3.0.19...v3.0.20) (2024-2-28) diff --git a/lerna.json b/lerna.json index 8222c13a..a902724d 100755 --- a/lerna.json +++ b/lerna.json @@ -2,7 +2,7 @@ "packages": [ "packages/*" ], - "version": "3.0.20", + "version": "3.0.21", "npmClient": "yarn", "useWorkspaces": true, "publishConfig": { diff --git a/packages/demo-saas/package.json b/packages/demo-saas/package.json index 457eb693..f9b5a9e0 100644 --- a/packages/demo-saas/package.json +++ b/packages/demo-saas/package.json @@ -1,6 +1,6 @@ { "name": "vue-demo-saas", - "version": "3.0.20", + "version": "3.0.21", "private": true, "scripts": { "serve": "vue-cli-service serve", @@ -8,7 +8,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { - "@frontegg/vue": "^3.0.20", + "@frontegg/vue": "^3.0.21", "vue": "^2.6.11", "vue-router": "^3.2.0" }, diff --git a/packages/example/package.json b/packages/example/package.json index 14343b99..366d01fa 100644 --- a/packages/example/package.json +++ b/packages/example/package.json @@ -1,6 +1,6 @@ { "name": "example-v3", - "version": "3.0.20", + "version": "3.0.21", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index ca0aeb35..7e948c25 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -1,6 +1,6 @@ { "name": "@frontegg/nuxt", - "version": "3.0.20", + "version": "3.0.21", "description": "", "main": "lib/module.js", "types": "types/index.d.ts", @@ -8,6 +8,6 @@ "lib" ], "dependencies": { - "@frontegg/vue": "^3.0.20" + "@frontegg/vue": "^3.0.21" } } diff --git a/packages/sanity-check/package.json b/packages/sanity-check/package.json index 795548aa..fd7fd64b 100644 --- a/packages/sanity-check/package.json +++ b/packages/sanity-check/package.json @@ -1,7 +1,7 @@ { "name": "frontegg-angular-sanity-check", "private": true, - "version": "3.0.20", + "version": "3.0.21", "scripts": { "build": "docker-compose build test", "build:dev": "docker-compose build test --no-cache", diff --git a/packages/vue/package.json b/packages/vue/package.json index 6cdcfa9d..7b132506 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@frontegg/vue", - "version": "3.0.20", + "version": "3.0.21", "description": "", "main": "dist/index.ssr.js", "browser": "dist/index.js", diff --git a/packages/vue/src/sdkVersion.ts b/packages/vue/src/sdkVersion.ts index 11b671c3..36f6a6b8 100644 --- a/packages/vue/src/sdkVersion.ts +++ b/packages/vue/src/sdkVersion.ts @@ -1 +1 @@ -export default { version: '3.0.20' }; +export default { version: '3.0.21' }; From e464443b6bad44efab838f98ad6892308087fb8a Mon Sep 17 00:00:00 2001 From: AtaliaRefua <102587122+AtaliaRefua@users.noreply.github.com> Date: Sun, 3 Mar 2024 17:57:31 +0200 Subject: [PATCH 6/9] Update CHANGELOG.md --- CHANGELOG.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf77d23c..4d059988 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,10 @@ -# Change Log - -## [3.0.21](https://github.com/frontegg/frontegg-vue/compare/v3.0.20...v3.0.21) (2024-3-3) - +# Change Log + +## [3.0.21](https://github.com/frontegg/frontegg-vue/compare/v3.0.20...v3.0.21) (2024-3-3) + - FR-15270 - Added new roles page to the Admin Portal - FR-15395 - Fixed tab tenant not cleared after logout - -- FR-15376 - fixed null group description exception - - + # Change Log ## [3.0.20](https://github.com/frontegg/frontegg-vue/compare/v3.0.19...v3.0.20) (2024-2-28) From eda71efe3abd2e5e36f200e581bdfb7d7b45db24 Mon Sep 17 00:00:00 2001 From: frontegg Date: Mon, 4 Mar 2024 11:28:32 +0000 Subject: [PATCH 7/9] chore(release): publish 3.0.22 --- CHANGELOG.md | 5 +++++ lerna.json | 2 +- packages/demo-saas/package.json | 4 ++-- packages/example/package.json | 2 +- packages/nuxt/package.json | 4 ++-- packages/sanity-check/package.json | 2 +- packages/vue/package.json | 2 +- packages/vue/src/sdkVersion.ts | 2 +- 8 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d059988..6df57faa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# Change Log + +## [3.0.22](https://github.com/frontegg/frontegg-vue/compare/v3.0.21...v3.0.22) (2024-3-4) + + # Change Log ## [3.0.21](https://github.com/frontegg/frontegg-vue/compare/v3.0.20...v3.0.21) (2024-3-3) diff --git a/lerna.json b/lerna.json index a902724d..a0af5af0 100755 --- a/lerna.json +++ b/lerna.json @@ -2,7 +2,7 @@ "packages": [ "packages/*" ], - "version": "3.0.21", + "version": "3.0.22", "npmClient": "yarn", "useWorkspaces": true, "publishConfig": { diff --git a/packages/demo-saas/package.json b/packages/demo-saas/package.json index f9b5a9e0..9bfb7306 100644 --- a/packages/demo-saas/package.json +++ b/packages/demo-saas/package.json @@ -1,6 +1,6 @@ { "name": "vue-demo-saas", - "version": "3.0.21", + "version": "3.0.22", "private": true, "scripts": { "serve": "vue-cli-service serve", @@ -8,7 +8,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { - "@frontegg/vue": "^3.0.21", + "@frontegg/vue": "^3.0.22", "vue": "^2.6.11", "vue-router": "^3.2.0" }, diff --git a/packages/example/package.json b/packages/example/package.json index 366d01fa..549e3343 100644 --- a/packages/example/package.json +++ b/packages/example/package.json @@ -1,6 +1,6 @@ { "name": "example-v3", - "version": "3.0.21", + "version": "3.0.22", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index 7e948c25..0014ece9 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -1,6 +1,6 @@ { "name": "@frontegg/nuxt", - "version": "3.0.21", + "version": "3.0.22", "description": "", "main": "lib/module.js", "types": "types/index.d.ts", @@ -8,6 +8,6 @@ "lib" ], "dependencies": { - "@frontegg/vue": "^3.0.21" + "@frontegg/vue": "^3.0.22" } } diff --git a/packages/sanity-check/package.json b/packages/sanity-check/package.json index fd7fd64b..344e5584 100644 --- a/packages/sanity-check/package.json +++ b/packages/sanity-check/package.json @@ -1,7 +1,7 @@ { "name": "frontegg-angular-sanity-check", "private": true, - "version": "3.0.21", + "version": "3.0.22", "scripts": { "build": "docker-compose build test", "build:dev": "docker-compose build test --no-cache", diff --git a/packages/vue/package.json b/packages/vue/package.json index 7b132506..74e149b2 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@frontegg/vue", - "version": "3.0.21", + "version": "3.0.22", "description": "", "main": "dist/index.ssr.js", "browser": "dist/index.js", diff --git a/packages/vue/src/sdkVersion.ts b/packages/vue/src/sdkVersion.ts index 36f6a6b8..55152500 100644 --- a/packages/vue/src/sdkVersion.ts +++ b/packages/vue/src/sdkVersion.ts @@ -1 +1 @@ -export default { version: '3.0.21' }; +export default { version: '3.0.22' }; From dacfeb023e887b5352ebac5088da6f9422a575ae Mon Sep 17 00:00:00 2001 From: frontegg Date: Wed, 20 Mar 2024 15:56:57 +0000 Subject: [PATCH 8/9] chore(release): publish 3.0.23 --- CHANGELOG.md | 10 ++++++++++ lerna.json | 2 +- packages/demo-saas/package.json | 4 ++-- packages/example/package.json | 2 +- packages/nuxt/package.json | 4 ++-- packages/sanity-check/package.json | 2 +- packages/vue/package.json | 2 +- packages/vue/src/sdkVersion.ts | 2 +- 8 files changed, 19 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6df57faa..a7efdf8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Change Log +## [3.0.23](https://github.com/frontegg/frontegg-vue/compare/v3.0.22...v3.0.23) (2024-3-20) + +- FR-15233 - Fix autocomplete popper + + +- FR-13828 - Add option to specify prompt consent from loginDirectAction +- FR-15315 - Added sort for role selections in Admin Portal + + + ## [3.0.22](https://github.com/frontegg/frontegg-vue/compare/v3.0.21...v3.0.22) (2024-3-4) diff --git a/lerna.json b/lerna.json index a0af5af0..4c9469eb 100755 --- a/lerna.json +++ b/lerna.json @@ -2,7 +2,7 @@ "packages": [ "packages/*" ], - "version": "3.0.22", + "version": "3.0.23", "npmClient": "yarn", "useWorkspaces": true, "publishConfig": { diff --git a/packages/demo-saas/package.json b/packages/demo-saas/package.json index 9bfb7306..2a781677 100644 --- a/packages/demo-saas/package.json +++ b/packages/demo-saas/package.json @@ -1,6 +1,6 @@ { "name": "vue-demo-saas", - "version": "3.0.22", + "version": "3.0.23", "private": true, "scripts": { "serve": "vue-cli-service serve", @@ -8,7 +8,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { - "@frontegg/vue": "^3.0.22", + "@frontegg/vue": "^3.0.23", "vue": "^2.6.11", "vue-router": "^3.2.0" }, diff --git a/packages/example/package.json b/packages/example/package.json index 549e3343..d947fdca 100644 --- a/packages/example/package.json +++ b/packages/example/package.json @@ -1,6 +1,6 @@ { "name": "example-v3", - "version": "3.0.22", + "version": "3.0.23", "private": true, "scripts": { "serve": "vue-cli-service serve", diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index 0014ece9..c0176dbc 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -1,6 +1,6 @@ { "name": "@frontegg/nuxt", - "version": "3.0.22", + "version": "3.0.23", "description": "", "main": "lib/module.js", "types": "types/index.d.ts", @@ -8,6 +8,6 @@ "lib" ], "dependencies": { - "@frontegg/vue": "^3.0.22" + "@frontegg/vue": "^3.0.23" } } diff --git a/packages/sanity-check/package.json b/packages/sanity-check/package.json index 344e5584..8e90f26b 100644 --- a/packages/sanity-check/package.json +++ b/packages/sanity-check/package.json @@ -1,7 +1,7 @@ { "name": "frontegg-angular-sanity-check", "private": true, - "version": "3.0.22", + "version": "3.0.23", "scripts": { "build": "docker-compose build test", "build:dev": "docker-compose build test --no-cache", diff --git a/packages/vue/package.json b/packages/vue/package.json index 188182c1..a1b2f7e4 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -1,6 +1,6 @@ { "name": "@frontegg/vue", - "version": "3.0.22", + "version": "3.0.23", "description": "", "main": "dist/index.ssr.js", "browser": "dist/index.js", diff --git a/packages/vue/src/sdkVersion.ts b/packages/vue/src/sdkVersion.ts index 55152500..c53a1231 100644 --- a/packages/vue/src/sdkVersion.ts +++ b/packages/vue/src/sdkVersion.ts @@ -1 +1 @@ -export default { version: '3.0.22' }; +export default { version: '3.0.23' }; From ca5118814a9191c5a81710161dd3c8ddb9e901e5 Mon Sep 17 00:00:00 2001 From: doregg Date: Sun, 24 Mar 2024 12:49:45 +0200 Subject: [PATCH 9/9] Remove entitlements V1 usage --- packages/vue/src/auth/entitlements.ts | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/packages/vue/src/auth/entitlements.ts b/packages/vue/src/auth/entitlements.ts index 36b7e16a..dae13a7d 100644 --- a/packages/vue/src/auth/entitlements.ts +++ b/packages/vue/src/auth/entitlements.ts @@ -9,10 +9,7 @@ import { AuthState, } from '@frontegg/redux-store'; -import { USE_ENTITLEMENTS_V2_ENDPOINT_FF } from '@frontegg/rest-api'; - import { authStateKey } from '../constants'; -import { useFeatureFlag } from '../auth/mapAuthState'; /** * @returns user state @@ -22,22 +19,13 @@ const useGetUserState = () => { return authState.user; }; -/** - * @returns true when need to use entitlements V2 API - */ -const useIsV2API = () => { - const [useEntitlementsV2] = useFeatureFlag([USE_ENTITLEMENTS_V2_ENDPOINT_FF]); - return useEntitlementsV2; -}; - /** * @param customAttributes consumer attributes - * @returns is entitled query data including: entitltments state, final attributes (consumer and frontegg) and API version to use + * @returns is entitled query data including: entitlements state and final attributes (consumer and frontegg) */ const useEntitlementsQueryData = (customAttributes?: CustomAttributes) => { const user = useGetUserState(); const entitlements = user?.entitlements; - const isV2 = useIsV2API(); const attributes: Attributes = { custom: customAttributes, @@ -47,7 +35,6 @@ const useEntitlementsQueryData = (customAttributes?: CustomAttributes) => { return { entitlements, attributes, - isV2 }; }; @@ -59,8 +46,8 @@ const useEntitlementsQueryData = (customAttributes?: CustomAttributes) => { */ export const useFeatureEntitlements = (key: string, customAttributes?: CustomAttributes): ComputedRef => { return computed(() => { - const { entitlements, attributes, isV2 } = useEntitlementsQueryData(customAttributes); - return getFeatureEntitlements(entitlements, key, attributes, isV2) + const { entitlements, attributes } = useEntitlementsQueryData(customAttributes); + return getFeatureEntitlements(entitlements, key, attributes, true) }); }; @@ -72,8 +59,8 @@ export const useFeatureEntitlements = (key: string, customAttributes?: CustomAtt */ export const usePermissionEntitlements = (key: string, customAttributes?: CustomAttributes): ComputedRef => { return computed(() => { - const { entitlements, attributes, isV2 } = useEntitlementsQueryData(customAttributes); - return getPermissionEntitlements(entitlements, key, attributes, isV2) + const { entitlements, attributes } = useEntitlementsQueryData(customAttributes); + return getPermissionEntitlements(entitlements, key, attributes, true) }); }; @@ -85,7 +72,7 @@ export const usePermissionEntitlements = (key: string, customAttributes?: Custom */ export const useEntitlements = (entitledToOptions: EntitledToOptions, customAttributes?: CustomAttributes): ComputedRef => { return computed(() => { - const { entitlements, attributes, isV2 } = useEntitlementsQueryData(customAttributes); - return getEntitlements(entitlements as any, entitledToOptions, attributes, isV2) + const { entitlements, attributes } = useEntitlementsQueryData(customAttributes); + return getEntitlements(entitlements, entitledToOptions, attributes, true) }); };