Skip to content

Conversation

@arthuracs
Copy link

@arthuracs arthuracs commented Sep 17, 2024

AP-5345

Instead of making another GET request to /frontegg/identity/resources/users/v2/me we can decode the same information from the JWT access token that we already received from the silent or token endpoints.

This PR also adds an impersonated: boolean property to the user data response to determine whether the current session is impersonated.

@arthuracs arthuracs force-pushed the get-userdata-from-accesstoken branch from dd276d9 to 811f303 Compare October 22, 2024 14:22
@arthuracs arthuracs marked this pull request as ready for review October 22, 2024 14:23
@arthuracs arthuracs requested a review from a team as a code owner October 22, 2024 14:23
@arthuracs arthuracs changed the title feat: decode user data from JWT access token feat: decode user data from JWT access token and add impersonated property Oct 22, 2024
@arthuracs arthuracs force-pushed the get-userdata-from-accesstoken branch from 811f303 to 4e24dcb Compare October 22, 2024 14:29
@arthuracs arthuracs force-pushed the get-userdata-from-accesstoken branch from 4e24dcb to 87e3f5d Compare October 22, 2024 14:31
Copy link
Contributor

@ondrejsevcik ondrejsevcik left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏼 Only a few cosmetic issues.

name: z.string(),
profilePictureUrl: z.string().nullable().optional(),
tenantId: z.string(),
act: z
Copy link
Contributor

@ondrejsevcik ondrejsevcik Oct 23, 2024

Choose a reason for hiding this comment

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

🟢 It would be good to add some link to Frontegg docs for this variable. For someone like me (who sees this first time), it would be very helpful.

Copy link
Author

Choose a reason for hiding this comment

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

Unfortunately there are none.

@arthuracs arthuracs merged commit cc0d853 into main Oct 23, 2024
5 checks passed
@lokalise-engineering
Copy link

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants