Skip to content

Commit

Permalink
feat: remove value field from token - OKTA-338251 (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
shuowu authored Oct 29, 2020
1 parent fee2940 commit b00271f
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 10 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
- [#469](https://github.com/okta/okta-auth-js/pull/469) Adds "rate limiting" logic to token autoRenew process to prevent too many requests be sent out which may cause application rate limit issue.
- [#503](https://github.com/okta/okta-auth-js/pull/503) Supports relative uri for [options.redirectUri](README.md#additional-options)
- [#478](https://github.com/okta/okta-auth-js/pull/478) Adds cross tabs communication to sync `AuthState`.
- [#515](https://github.com/okta/okta-auth-js/pull/515) Removes `token.value` field

### Bug Fixes

Expand Down
2 changes: 0 additions & 2 deletions lib/token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ function handleOAuthResponse(sdk: OktaAuth, tokenParams: TokenParams, res: OAuth

if (accessToken) {
tokenDict.accessToken = {
value: accessToken,
accessToken: accessToken,
expiresAt: Number(expiresIn) + Math.floor(Date.now()/1000),
tokenType: tokenType,
Expand All @@ -276,7 +275,6 @@ function handleOAuthResponse(sdk: OktaAuth, tokenParams: TokenParams, res: OAuth
var jwt = sdk.token.decode(idToken);

var idTokenObj: IDToken = {
value: idToken,
idToken: idToken,
claims: jwt.payload,
expiresAt: jwt.payload.exp,
Expand Down
1 change: 0 additions & 1 deletion lib/types/Token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { UserClaims } from './UserClaims';

export interface AbstractToken {
expiresAt: number;
value: string;
authorizeUrl: string;
scopes: string[];
}
Expand Down
1 change: 0 additions & 1 deletion test/support/oauthUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ function validateResponse(res, expectedResp) {
expect(actual).toEqual(expected);
return;
}
expect(actual.value).toEqual(expected.value);
expect(actual.idToken).toEqual(expected.idToken);
expect(actual.claims).toEqual(expected.claims);
expect(actual.accessToken).toEqual(expected.accessToken);
Expand Down
6 changes: 0 additions & 6 deletions test/support/tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ tokens.standardIdTokenClaims = {
};

tokens.standardIdTokenParsed = {
value: tokens.standardIdToken,
idToken: tokens.standardIdToken,
claims: tokens.standardIdTokenClaims,
expiresAt: 1449699930,
Expand Down Expand Up @@ -106,7 +105,6 @@ tokens.standardIdToken2Claims = {
};

tokens.standardIdToken2Parsed = {
value: tokens.standardIdToken2,
idToken: tokens.standardIdToken2,
claims: tokens.standardIdToken2Claims,
expiresAt: 1449699930,
Expand Down Expand Up @@ -151,7 +149,6 @@ tokens.expiredBeforeIssuedIdTokenClaims = {
};

tokens.expiredBeforeIssuedIdTokenParsed = {
value: tokens.expiredBeforeIssuedIdToken,
idToken: tokens.expiredBeforeIssuedIdToken,
claims: tokens.expiredBeforeIssuedIdTokenClaims,
expiresAt: 1449690000,
Expand Down Expand Up @@ -189,7 +186,6 @@ tokens.authServerIdTokenClaims = {
};

tokens.authServerIdTokenParsed = {
value: tokens.authServerIdToken,
idToken: tokens.authServerIdToken,
claims: tokens.authServerIdTokenClaims,
expiresAt: 1449699930,
Expand Down Expand Up @@ -248,7 +244,6 @@ tokens.standardAccessToken = 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXIiOj' +
'EQ9-Ua9rPOMaO0pFC6h2lfB_HfzGifXATKsN-wLdxk6cgA';

tokens.standardAccessTokenParsed = {
value: tokens.standardAccessToken,
accessToken: tokens.standardAccessToken,
expiresAt: 1449703529, // assuming time = 1449699929
scopes: ['openid', 'email'],
Expand All @@ -271,7 +266,6 @@ tokens.authServerAccessToken = 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXIiOjE
'h9gY9Z3xd92ac407ZIOHkabLvZ0-45ANM3Gm0LC0c';

tokens.authServerAccessTokenParsed = {
value: tokens.authServerAccessToken,
accessToken: tokens.authServerAccessToken,
expiresAt: 1449703529, // assuming time = 1449699929
scopes: ['openid', 'email'],
Expand Down

0 comments on commit b00271f

Please sign in to comment.