Skip to content

Commit f500d46

Browse files
committed
chore(backend): Warn about clockSkewInSeconds deprecation
1 parent 362caaa commit f500d46

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

packages/backend/src/tokens/jwt/verifyJwt.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { Jwt, JwtPayload } from '@clerk/types';
44
// For more information refer to https://sinonjs.org/how-to/stub-dependency/
55
import runtime from '../../runtime';
66
import { base64url } from '../../util/rfc4648';
7+
import { deprecated } from '../../util/shared';
78
import { TokenVerificationError, TokenVerificationErrorAction, TokenVerificationErrorReason } from '../errors';
89
import type { IssuerResolver } from './assertions';
910
import {
@@ -114,6 +115,10 @@ export async function verifyJwt(
114115
token: string,
115116
{ audience, authorizedParties, clockSkewInSeconds, clockSkewInMs, issuer, key }: VerifyJwtOptions,
116117
): Promise<JwtPayload> {
118+
if (clockSkewInSeconds) {
119+
deprecated('clockSkewInSeconds', 'Use `clockSkewInMs` instead.');
120+
}
121+
117122
const clockSkew = clockSkewInMs || clockSkewInSeconds || DEFAULT_CLOCK_SKEW_IN_SECONDS;
118123

119124
const decoded = decodeJwt(token);

0 commit comments

Comments
 (0)