Skip to content

Add idToken to TokenSet in SessionData#1978

Merged
arpit-jn merged 3 commits intomainfrom
feature/idtoken-in-tokenset
Mar 28, 2025
Merged

Add idToken to TokenSet in SessionData#1978
arpit-jn merged 3 commits intomainfrom
feature/idtoken-in-tokenset

Conversation

@tusharpandey13
Copy link
Contributor

@tusharpandey13 tusharpandey13 commented Mar 19, 2025

📋 Changes

Co-authored-by: kenkoooo kenkou.n@gmail.com
Added the field idToken in TokenSet type of SessionData allowing for easy access.

📎 References

🎯 Testing

PASSING

Test Files  9 passed (9)
      Tests  143 passed (143)
   Start at  15:39:48
   Duration  611ms (transform 351ms, setup 0ms, collect 969ms, tests 188ms, environment 1ms, prepare 414ms)

use the getSession() method to access tokenSet:

const session = await auth0.getSession();
const idToken = session.tokenSet.idToken;

Co-authored-by: kenkoooo <kenkou.n@gmail.com>
@tusharpandey13 tusharpandey13 requested a review from a team as a code owner March 19, 2025 10:07
@tusharpandey13 tusharpandey13 changed the title feat: add idToken support in AuthClient Add idToken to TokenSet in SessionData Mar 19, 2025
nandan-bhat
nandan-bhat previously approved these changes Mar 20, 2025
@codecov-commenter
Copy link

codecov-commenter commented Mar 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.19%. Comparing base (3caf259) to head (ca1b5c2).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1978      +/-   ##
==========================================
+ Coverage   76.16%   76.19%   +0.03%     
==========================================
  Files          21       21              
  Lines        1523     1525       +2     
  Branches      242      242              
==========================================
+ Hits         1160     1162       +2     
  Misses        356      356              
  Partials        7        7              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@kishore7snehil kishore7snehil left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@arpit-jn arpit-jn left a comment

Choose a reason for hiding this comment

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

LGTM

@arpit-jn arpit-jn merged commit 3a1e7b3 into main Mar 28, 2025
12 checks passed
@arpit-jn arpit-jn deleted the feature/idtoken-in-tokenset branch March 28, 2025 15:50
This was referenced Mar 28, 2025
@ik-southpole
Copy link

ik-southpole commented Apr 4, 2025

Is there a way to opt-out from ID token being added to cookies?

From version v4.3.0, two cookies resulted in a larger size making some APIs failing with 431 Request Header Fields Too Large.

We will check if we can quickly switch to custom store. However, I would like to point out that update from v4.2.1 -> v4.3.0 broke our application because of ID token being added to the cookie resulting in the larger size that our APIs could not support.

@frederikprijck
Copy link
Member

frederikprijck commented Apr 4, 2025

From version v4.3.0, two cookies resulted in a larger size making some APIs failing with 431 Request Header Fields Too Large.

What is the allowed size on your backend (which backend are you using?)? Things like node have a limit of 16KB.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants