Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(email): stop double email init on login (#4109)

gbirmand78ab289bef8
diff --git a/js/app/packages/app/component/auth/Login.tsx b/js/app/packages/app/component/auth/Login.tsx
index 0f2e825932..c1a33c5131 100644
--- a/js/app/packages/app/component/auth/Login.tsx
+++ b/js/app/packages/app/component/auth/Login.tsx
@@ -45,17 +45,10 @@ export function Login() {
function PostLoginRedirect() {
const navigate = useNavigate();
- const { initEmailLink } = useEmailLinks();
- onMount(async () => {
- await initEmailLink().match(
- () => {},
- (err) => {
- if (err.tag !== 'AlreadyInitialized') {
- console.error('Failed to init email link on login', err);
- }
- }
- );
+ // Login init is owned by the per-method handlers (the session-token effect and
+ // onComplete); this redirect only navigates, so login doesn't fire init twice.
+ onMount(() => {
navigate('/', { replace: true });
});
diff --git a/js/app/packages/app/component/auth/LoginNew.tsx b/js/app/packages/app/component/auth/LoginNew.tsx
index fd7b043af1..97f93ac2f8 100644
--- a/js/app/packages/app/component/auth/LoginNew.tsx
+++ b/js/app/packages/app/component/auth/LoginNew.tsx
@@ -45,17 +45,10 @@ import { useSsoLogin } from './useSsoLogin';
function PostLoginRedirect() {
const navigate = useNavigate();
- const { initEmailLink } = useEmailLinks();
- onMount(async () => {
- await initEmailLink().match(
- () => {},
- (err) => {
- if (err.tag !== 'AlreadyInitialized') {
- console.error('Failed to init email link on login', err);
- }
- }
- );
+ // Login init is owned by the per-method handlers (the session-token effect and
+ // onComplete); this redirect only navigates, so login doesn't fire init twice.
+ onMount(() => {
navigate('/', { replace: true });
});