Skip to content

login: wrap and propagate errors - #232

Merged
Fizzadar merged 1 commit into
mainfrom
nick/login-error-propagation
Aug 12, 2026
Merged

login: wrap and propagate errors#232
Fizzadar merged 1 commit into
mainfrom
nick/login-error-propagation

Conversation

@Fizzadar

Copy link
Copy Markdown
Member

No description provided.

Wait() returned plain errors for verification and login failures, so the
provisioning API replaced them with a generic 500 M_UNKNOWN "Internal error in
login step". Map them onto declared RespErrors instead, reusing the existing
parseLoginErrorDetails so LINE's own short reason strings are quoted where it
gives one.

Also stop formatting the raw Go error into the login form instructions when no
reason could be parsed. That put internal detail directly in user-facing copy;
it now shows a fixed message.

CreateLogin ignored flowID entirely and returned the email login for any value,
including a typo. Validate it against the advertised flow ID and return
bridgev2.ErrInvalidLoginFlowID otherwise, and give that ID a named constant so
the flow list and the check cannot drift apart.

Note this does not change the larger contract question: a rejected password is
still reported as a fresh user_input step on HTTP 200 rather than an error, so
clients cannot distinguish it from a legitimate next step. That is worth
deciding deliberately before changing.
@Fizzadar
Fizzadar requested a review from highesttt August 12, 2026 17:00
@indent

indent Bot commented Aug 12, 2026

Copy link
Copy Markdown
PR Summary

Maps LINE login failures to structured, client-actionable errors and stops leaking raw Go error strings into user-facing login copy.

  • Adds pkg/connector/loginerrors.go with bridgev2.RespError sentinels (verification failed, no keychain, too many attempts, rejected, unknown) and wrapLineLoginError, which maps LINE errors by blocked-user reason / HTTP 429 / 401-403 / quoted reason and keeps the original error in the chain (%w) for logs.
  • Wait and finishLogin now return these structured errors, so the provisioning API responds with meaningful error codes and statuses (400/401/429/500) instead of a generic 500.
  • Credential-submit failures fall back to a generic message instead of embedding the raw error in the login form instructions.
  • Extracts LoginFlowIDEmail and rejects unknown flow IDs in CreateLogin with bridgev2.ErrInvalidLoginFlowID; the affected test now passes the constant.

Issues

Review closed.

CI Checks

All CI checks passed on 45b1d62.

@Fizzadar
Fizzadar merged commit 4d63311 into main Aug 12, 2026
8 checks passed
@Fizzadar
Fizzadar deleted the nick/login-error-propagation branch August 12, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants