Skip to content

Commit

Permalink
Merge pull request #51 from kinde-oss/fix/ts-lint-issues
Browse files Browse the repository at this point in the history
fix: ts-lint errors
  • Loading branch information
DanielRivers authored Mar 11, 2024
2 parents a0353d6 + 1d23640 commit 0f4bfcf
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ parserOptions:
ignorePatterns:
- dist
- dist-cjs
- lib/__tests__/**
- lib/apis/**
- lib/models/**
- lib/index.ts
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-test-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ jobs:
run: pnpm config set enable-pre-post-scripts true
- run: pnpm install
- run: pnpm build
- run: pnpm lint
- run: pnpm test
2 changes: 1 addition & 1 deletion lib/sdk/clients/browser/authcode-with-pkce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ const createAuthCodeWithPKCEClient = (options: BrowserPKCEClientOptions) => {
`Cannot return claim "${claim}", no authentication credential found`
);
}
return tokenClaims.getClaimValue(sessionManager, claim, type);
return await tokenClaims.getClaimValue(sessionManager, claim, type);
};

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/sdk/clients/server/authorization-code.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthorizationCode, AuthCodeWithPKCE } from '../../oauth2-flows/index.js';
import { default as withAuthUtilities } from './with-auth-utilities.js';
import withAuthUtilities from './with-auth-utilities.js';
import { type SessionManager } from '../../session-managers/index.js';
import type { UserType } from '../../utilities/index.js';
import * as utilities from '../../utilities/index.js';
Expand Down
2 changes: 1 addition & 1 deletion lib/sdk/clients/server/client-credentials.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { default as withAuthUtilities } from './with-auth-utilities.js';
import withAuthUtilities from './with-auth-utilities.js';
import { type SessionManager } from '../../session-managers/index.js';
import { ClientCredentials } from '../../oauth2-flows/index.js';
import type { CCClientOptions } from '../types.js';
Expand Down
4 changes: 2 additions & 2 deletions lib/sdk/clients/server/with-auth-utilities.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SessionManager } from '../../session-managers';
import { type SessionManager } from '../../session-managers';
import * as utilities from '../../utilities/index.js';

import type {
Expand Down Expand Up @@ -93,7 +93,7 @@ const withAuthUtilities = (
`Cannot return claim "${claim}", no authentication credential found`
);
}
return tokenClaims.getClaimValue(sessionManager, claim, type);
return await tokenClaims.getClaimValue(sessionManager, claim, type);
};

/**
Expand Down
1 change: 0 additions & 1 deletion lib/sdk/utilities/token-claims.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { type SessionManager } from '../session-managers/index.js';
import { isTokenExpired } from './token-utils.js';
import { type ClaimTokenType } from './types.js';
import { jwtDecode } from 'jwt-decode';

Expand Down
2 changes: 1 addition & 1 deletion lib/sdk/utilities/token-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,5 +133,5 @@ export const isTokenExpired = (token: string | null): boolean => {
const currentUnixTime = Math.floor(Date.now() / 1000);
const tokenPayload = jwtDecode(token);
if (!tokenPayload.exp) return true;
return currentUnixTime >= tokenPayload.exp!;
return currentUnixTime >= tokenPayload.exp;
};

0 comments on commit 0f4bfcf

Please sign in to comment.