From 261821e78a2f2de1d0ee76dfdfb609a0a1afdbd1 Mon Sep 17 00:00:00 2001 From: Brian Demers Date: Wed, 4 Aug 2021 19:12:50 -0400 Subject: [PATCH] Use idToken claims instead of UserInfo on Profile page --- custom-login/src/components/Profile.vue | 3 ++- okta-hosted-login/src/components/Profile.vue | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/custom-login/src/components/Profile.vue b/custom-login/src/components/Profile.vue index fac8f69..f58e398 100644 --- a/custom-login/src/components/Profile.vue +++ b/custom-login/src/components/Profile.vue @@ -57,7 +57,8 @@ export default { } }, async created () { - this.claims = await Object.entries(await this.$auth.getUser()).map(entry => ({ claim: entry[0], value: entry[1] })) + const idToken = await this.$auth.tokenManager.get('idToken') + this.claims = await Object.entries(idToken.claims).map(entry => ({ claim: entry[0], value: entry[1] })) } } diff --git a/okta-hosted-login/src/components/Profile.vue b/okta-hosted-login/src/components/Profile.vue index 441d4d4..7fc4aea 100644 --- a/okta-hosted-login/src/components/Profile.vue +++ b/okta-hosted-login/src/components/Profile.vue @@ -57,7 +57,8 @@ export default { } }, async created () { - this.claims = await Object.entries(await this.$auth.getUser()).map(entry => ({ claim: entry[0], value: entry[1] })) + const idToken = await this.$auth.tokenManager.get('idToken') + this.claims = await Object.entries(idToken.claims).map(entry => ({ claim: entry[0], value: entry[1] })) } }