Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Attach extra token response claims as property on user object #1346

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

kherock
Copy link

@kherock kherock commented Apr 21, 2021

Hi, thanks for the amazing work on this library. I'm hoping this change can make it in quickly!

I'm using this library against a service implementing the SMART on FHIR OAuth extension. Upon signin, the token response has a few extra parameters that are passed to this library's User constructor, but they aren't stored anywhere. I've looked closely and there doesn't seem to be a good way to read these properties short of reimplementing most of UserManager. As such I've modified the constructor to store these additional fields as otherClaims.

@@ -53,7 +54,8 @@ export class User {
token_type: this.token_type,
scope: this.scope,
profile: this.profile,
expires_at: this.expires_at
expires_at: this.expires_at,
...this.otherClaims
Copy link

@lvendrame lvendrame Jun 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be ...this.otherValues, as the constructor is storing the value in this property

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants