Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(core): auth fail reason should be error.name (#8822)

forehalo6a640558861c
diff --git a/packages/frontend/core/src/modules/cloud/services/auth.ts b/packages/frontend/core/src/modules/cloud/services/auth.ts
index e8fd6b5cc6..a011e13559 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;
}