From 6a640558861c5534c4a0daf0a030a0a300c51678 Mon Sep 17 00:00:00 2001 From: forehalo Date: Thu, 14 Nov 2024 09:24:01 +0000 Subject: [PATCH] fix(core): auth fail reason should be error.name (#8822) fix AF-1701 --- .../frontend/core/src/modules/cloud/services/auth.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/frontend/core/src/modules/cloud/services/auth.ts b/packages/frontend/core/src/modules/cloud/services/auth.ts index e8fd6b5cc675d..a011e13559f78 100644 --- a/packages/frontend/core/src/modules/cloud/services/auth.ts +++ b/packages/frontend/core/src/modules/cloud/services/auth.ts @@ -114,7 +114,7 @@ export class AuthService extends Service { } catch (e) { track.$.$.auth.signInFail({ method: 'magic-link', - reason: e instanceof BackendError ? e.originError.type : 'unknown', + reason: e instanceof BackendError ? e.originError.name : 'unknown', }); throw e; } @@ -135,7 +135,7 @@ export class AuthService extends Service { } catch (e) { track.$.$.auth.signInFail({ method: 'magic-link', - reason: e instanceof BackendError ? e.originError.type : 'unknown', + reason: e instanceof BackendError ? e.originError.name : 'unknown', }); throw e; } @@ -176,7 +176,7 @@ export class AuthService extends Service { track.$.$.auth.signInFail({ method: 'oauth', provider, - reason: e instanceof BackendError ? e.originError.type : 'unknown', + reason: e instanceof BackendError ? e.originError.name : 'unknown', }); throw e; } @@ -200,7 +200,7 @@ export class AuthService extends Service { track.$.$.auth.signInFail({ method: 'oauth', provider, - reason: e instanceof BackendError ? e.originError.type : 'unknown', + reason: e instanceof BackendError ? e.originError.name : 'unknown', }); throw e; } @@ -229,7 +229,7 @@ export class AuthService extends Service { } catch (e) { track.$.$.auth.signInFail({ method: 'password', - reason: e instanceof BackendError ? e.originError.type : 'unknown', + reason: e instanceof BackendError ? e.originError.name : 'unknown', }); throw e; }