11import type { AuthObject , RequestState } from '@clerk/backend' ;
22import { buildRequestUrl , constants , TokenVerificationErrorReason } from '@clerk/backend' ;
33import { DEV_BROWSER_JWT_MARKER , setDevBrowserJWTInURL } from '@clerk/shared/devBrowser' ;
4- import { isDevelopmentFromApiKey } from '@clerk/shared/keys' ;
4+ import { isDevelopmentFromSecretKey } from '@clerk/shared/keys' ;
55import type { Autocomplete } from '@clerk/types' ;
66import type Link from 'next/link' ;
77import type { NextFetchEvent , NextMiddleware , NextRequest } from 'next/server' ;
@@ -162,7 +162,7 @@ const authMiddleware: AuthMiddleware = (...args: unknown[]) => {
162162
163163 if ( isIgnoredRoute ( req ) ) {
164164 logger . debug ( { isIgnoredRoute : true } ) ;
165- if ( isDevelopmentFromApiKey ( options . secretKey || SECRET_KEY ) && ! params . ignoredRoutes ) {
165+ if ( isDevelopmentFromSecretKey ( options . secretKey || SECRET_KEY ) && ! params . ignoredRoutes ) {
166166 console . warn (
167167 receivedRequestForIgnoredRoute ( req . experimental_clerkUrl . href , JSON . stringify ( DEFAULT_CONFIG_MATCHER ) ) ,
168168 ) ;
@@ -296,7 +296,7 @@ const appendDevBrowserOnCrossOrigin = (req: WithClerkUrl<NextRequest>, res: Resp
296296 if (
297297 shouldAppendDevBrowser &&
298298 ! ! location &&
299- isDevelopmentFromApiKey ( opts . secretKey || SECRET_KEY ) &&
299+ isDevelopmentFromSecretKey ( opts . secretKey || SECRET_KEY ) &&
300300 isCrossOrigin ( req . experimental_clerkUrl , location )
301301 ) {
302302 const dbJwt = req . cookies . get ( DEV_BROWSER_JWT_MARKER ) ?. value || '' ;
@@ -345,7 +345,7 @@ const isRequestMethodIndicatingApiRoute = (req: NextRequest): boolean => {
345345 * In development, attempt to detect clock skew based on the requestState. This check should run when requestState.isInterstitial is true. If detected, we throw an error.
346346 */
347347const assertClockSkew = ( requestState : RequestState , opts : AuthMiddlewareParams ) : void => {
348- if ( ! isDevelopmentFromApiKey ( opts . secretKey || SECRET_KEY ) ) {
348+ if ( ! isDevelopmentFromSecretKey ( opts . secretKey || SECRET_KEY ) ) {
349349 return ;
350350 }
351351
@@ -363,7 +363,7 @@ const assertInfiniteRedirectionLoop = (
363363 opts : AuthMiddlewareParams ,
364364 requestState : RequestState ,
365365) : NextResponse => {
366- if ( ! isDevelopmentFromApiKey ( opts . secretKey || SECRET_KEY ) ) {
366+ if ( ! isDevelopmentFromSecretKey ( opts . secretKey || SECRET_KEY ) ) {
367367 return res ;
368368 }
369369
@@ -403,7 +403,7 @@ const withNormalizedClerkUrl = (req: NextRequest): WithClerkUrl<NextRequest> =>
403403} ;
404404
405405const informAboutProtectedRoute = ( path : string , params : AuthMiddlewareParams , isApiRoute : boolean ) => {
406- if ( params . debug || isDevelopmentFromApiKey ( params . secretKey || SECRET_KEY ) ) {
406+ if ( params . debug || isDevelopmentFromSecretKey ( params . secretKey || SECRET_KEY ) ) {
407407 console . warn (
408408 informAboutProtectedRouteInfo (
409409 path ,
0 commit comments