From 12e684f83a07bff194983e534cd068d1cf88ad89 Mon Sep 17 00:00:00 2001 From: joel Date: Thu, 26 Sep 2024 10:54:04 +0200 Subject: [PATCH 1/2] fix: clean up todos --- src/GoTrueClient.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/GoTrueClient.ts b/src/GoTrueClient.ts index c105be617..3c590072f 100644 --- a/src/GoTrueClient.ts +++ b/src/GoTrueClient.ts @@ -313,11 +313,8 @@ export default class GoTrueClient { if (error) { this._debug('#_initialize()', 'error detecting session from URL', error) - // hacky workaround to keep the existing session if there's an error returned from identity linking - // TODO: once error codes are ready, we should match against it instead of the message if ( - error?.message === 'Identity is already linked' || - error?.message === 'Identity is already linked to another user' + error?.code === identity_already_exists ) { return { error } } @@ -2388,11 +2385,6 @@ export default class GoTrueClient { return { data: null, error } } - // TODO: Remove once: https://github.com/supabase/auth/pull/1717 is deployed - if (params.factorType === 'phone') { - delete data.totp - } - if (params.factorType === 'totp' && data?.totp?.qr_code) { data.totp.qr_code = `data:image/svg+xml;utf-8,${data.totp.qr_code}` } From 273e3692875e59e9b041523216d739498f153984 Mon Sep 17 00:00:00 2001 From: Joel Lee Date: Thu, 26 Sep 2024 11:00:58 +0200 Subject: [PATCH 2/2] fix: apply suggestions from code review --- src/GoTrueClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GoTrueClient.ts b/src/GoTrueClient.ts index 3c590072f..207675323 100644 --- a/src/GoTrueClient.ts +++ b/src/GoTrueClient.ts @@ -314,7 +314,7 @@ export default class GoTrueClient { this._debug('#_initialize()', 'error detecting session from URL', error) if ( - error?.code === identity_already_exists + error?.code === 'identity_already_exists' ) { return { error } }