Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 423397d

Browse files
committedApr 14, 2025·
Mark and check auth as instrumented
1 parent 0c3ff1d commit 423397d

File tree

2 files changed

+5
-3
lines changed
  • dev-packages/e2e-tests/test-applications/supabase-nextjs/supabase
  • packages/core/src/integrations

2 files changed

+5
-3
lines changed
 

Diff for: ‎dev-packages/e2e-tests/test-applications/supabase-nextjs/supabase/config.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ sign_in_sign_ups = 30
141141
# Number of OTP / Magic link verifications that can be made in a 5 minute interval per IP address.
142142
token_verifications = 30
143143

144+
144145
# Configure one of the supported captcha providers: `hcaptcha`, `turnstile`.
145146
# [auth.captcha]
146147
# enabled = true
@@ -282,8 +283,6 @@ enabled = true
282283
policy = "oneshot"
283284
# Port to attach the Chrome inspector for debugging edge functions.
284285
inspector_port = 8083
285-
# The Deno major version to use.
286-
deno_version = 1
287286

288287
# [edge_runtime.secrets]
289288
# secret_key = "env(SECRET_VALUE)"

Diff for: ‎packages/core/src/integrations/supabase.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,11 @@ function instrumentAuthOperation(operation: AuthOperationFn, isAdmin = false): A
267267
function instrumentSupabaseAuthClient(supabaseClientInstance: SupabaseClientInstance): void {
268268
const auth = supabaseClientInstance.auth;
269269

270-
if (!auth) {
270+
if (!auth || isInstrumented(supabaseClientInstance.auth)) {
271271
return;
272272
}
273273

274+
274275
for (const operation of AUTH_OPERATIONS_TO_INSTRUMENT) {
275276
const authOperation = auth[operation];
276277

@@ -294,6 +295,8 @@ function instrumentSupabaseAuthClient(supabaseClientInstance: SupabaseClientInst
294295
supabaseClientInstance.auth.admin[operation] = instrumentAuthOperation(authOperation, true);
295296
}
296297
}
298+
299+
markAsInstrumented(supabaseClientInstance.auth);
297300
}
298301

299302
function instrumentSupabaseClientConstructor(SupabaseClient: unknown): void {

0 commit comments

Comments
 (0)
Please sign in to comment.