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.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
chore(core): track otp usage (#10248)
forehalocd00f06b77c4
diff --git a/packages/frontend/core/src/components/sign-in/sign-in-with-email.tsx b/packages/frontend/core/src/components/sign-in/sign-in-with-email.tsxindex 0337d754d3..83550acfb8 100644--- a/packages/frontend/core/src/components/sign-in/sign-in-with-email.tsx+++ b/packages/frontend/core/src/components/sign-in/sign-in-with-email.tsx@@ -141,7 +141,7 @@ export const SignInWithEmailStep = ({setIsVerifying(true);try {- await authService.signInMagicLink(email, otp);+ await authService.signInMagicLink(email, otp, false);} catch (e) {if (e instanceof BackendError) {notify.error({diff --git a/packages/frontend/core/src/modules/cloud/services/auth.ts b/packages/frontend/core/src/modules/cloud/services/auth.tsindex 8f51a043a6..79e771131b 100644--- a/packages/frontend/core/src/modules/cloud/services/auth.ts+++ b/packages/frontend/core/src/modules/cloud/services/auth.ts@@ -109,7 +109,8 @@ export class AuthService extends Service {}}- async signInMagicLink(email: string, token: string) {+ async signInMagicLink(email: string, token: string, byLink = true) {+ const method = byLink ? 'magic-link' : 'otp';try {await this.fetchService.fetch('/api/auth/magic-link', {method: 'POST',@@ -120,10 +121,10 @@ export class AuthService extends Service {});this.session.revalidate();- track.$.$.auth.signedIn({ method: 'magic-link' });+ track.$.$.auth.signedIn({ method });} catch (e) {track.$.$.auth.signInFail({- method: 'magic-link',+ method,reason: e instanceof BackendError ? e.originError.name : 'unknown',});throw e;diff --git a/packages/frontend/track/src/events.ts b/packages/frontend/track/src/events.tsindex 2f2f112997..41d465daf2 100644--- a/packages/frontend/track/src/events.ts+++ b/packages/frontend/track/src/events.ts@@ -439,7 +439,7 @@ type SplitViewActionControlType = 'menu' | 'indicator';type SplitViewActionType = 'open' | 'close' | 'move' | 'closeOthers';type AuthArgs = {- method: 'password' | 'magic-link' | 'oauth';+ method: 'password' | 'magic-link' | 'oauth' | 'otp';provider?: string;};