fix(auth): unify browser auth with MFA across all login paths

- Create shared authenticateWithBrowserMFA utility in auth-ui.ts
- Update auth.command.ts to use shared utility for tm auth login
- Update auth-guard.ts to use shared utility for parse-prd/export
- Fix oauth-service.ts to NOT call onError for MFA_REQUIRED
  (MFA requirement is a continuation, not a failure)

All login paths now use the same MFA-aware browser auth flow:
- tm auth login
- tm parse-prd (Bring it to Hamster)
- tm export
This commit is contained in:
Eyal Toledano
2025-12-01 21:21:10 -05:00
parent edeeef4d92
commit 3038fa42a0
4 changed files with 124 additions and 157 deletions

View File

@@ -114,8 +114,9 @@ export class OAuthService {
error
);
// Notify error
if (onError) {
// Only notify error for actual failures, NOT for MFA_REQUIRED
// MFA requirement is a continuation of the auth flow, not an error
if (onError && authError.code !== 'MFA_REQUIRED') {
onError(authError);
}