Skip to content

[ONB-2195] Validate pasted key prefix against --mode#51

Merged
FranciscaOtero merged 2 commits into
mainfrom
onb-2195-validar-prefijo-de-la-key-pegada-contra-mode-en-el-fallback
Jun 3, 2026
Merged

[ONB-2195] Validate pasted key prefix against --mode#51
FranciscaOtero merged 2 commits into
mainfrom
onb-2195-validar-prefijo-de-la-key-pegada-contra-mode-en-el-fallback

Conversation

@FranciscaOtero

Copy link
Copy Markdown
Collaborator

Contexto

El paste fallback de fintoc login valida el formato de la key pero no que su prefijo coincida con --mode, dejando una sesión inconsistente.

Que hay de nuevo?

  • Rechazar localmente el paste cuando modeFromSecret(key) !== mode, reutilizando el handler de mismatch que ya existe.
  • Extraer modeFromSecret y FintocMode a src/lib/secret.ts.

Tests

  • Tests unitarios.

Created with Claude Code /create-pr command

@FranciscaOtero FranciscaOtero self-assigned this Jun 3, 2026
@FranciscaOtero FranciscaOtero marked this pull request as ready for review June 3, 2026 17:17
@FranciscaOtero FranciscaOtero requested a review from daleal June 3, 2026 17:19

@daleal daleal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dejo approve, porque en verdad creo que no hay cómo arreglar lo del startsWith jajaja

Comment thread src/lib/secret.ts Outdated
Comment thread src/lib/secret.ts Outdated
FranciscaOtero and others added 2 commits June 3, 2026 13:36
Rename BrowserLoginMode to FintocMode and centralize it in src/types.ts
so it can be reused across the login flow without coupling commands to
the browser-login lib.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The paste fallback in fintoc login validated key format but not that the
prefix matched --mode, leaving an inconsistent session. Add a local
modeFromSecret helper and reuse the existing 'mismatch' handler so the
user is hinted at the right --mode value.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@FranciscaOtero FranciscaOtero force-pushed the onb-2195-validar-prefijo-de-la-key-pegada-contra-mode-en-el-fallback branch from aa5868e to 43646cc Compare June 3, 2026 17:37
@FranciscaOtero FranciscaOtero merged commit 752f51f into main Jun 3, 2026
2 checks passed
@FranciscaOtero FranciscaOtero deleted the onb-2195-validar-prefijo-de-la-key-pegada-contra-mode-en-el-fallback branch June 3, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants