Repository navigation
Return an accurate Account Deactivated error when user is deactivated - #2867
Draft
szabozoltan69 wants to merge 1 commit into
Draft
szabozoltan69 wants to merge 1 commit into
szabozoltan69 wants to merge 1 commit into
Conversation
Contributor
Author
|
@frozenhelium – if you have any thoughts about this, welcome! |
szabozoltan69
force-pushed
the
fix/accurate-login-message
branch
from
October 15, 2026 08:51
4ea9fa1 to
dbbc11d
Compare
szabozoltan69
force-pushed
the
fix/accurate-login-message
branch
from
October 15, 2026 09:07
dbbc11d to
a3c9682
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refers to IFRCGo/go-web-app#855
Has go-web-app side task also:
app/src/views/Login/index.tsx currently does this on failure:
app/src/utils/restRequest/go.ts already has logic that recognizes go-api's {statusCode, error_message} shape ("Old Standard Error") and turns it into formErrors.non_field_errors = [error_message] / messageForNotification = error_message. That means our new error_message ("Your account is deactivated...") will already surface via on the form — without any frontend change.
However, error_code (our new 4013) is currently dropped entirely by transformError — it only reads statusCode/error_message, nothing else. So the frontend has no reliable way to branch on it today.
The gap / recommended go-web-app task
Toast is misleading today: alert.show(strings.loginFailureMessage, ...) always shows the same generic hardcoded message regardless of the real reason, while the accurate message only appears in the smaller NonFieldError box. At minimum, this should show error.value.messageForNotification instead of the static string, so the deactivated message is prominent, not just incidental.
(Better) Surface error_code: thread error_code through TransformedError/transformError in go.ts so Login/index.tsx can check error.value.errorCode === 4013 explicitly and render a dedicated message/action (e.g. a clickable mailto:im@ifrc.org link) instead of relying on string matching against English backend text — this also avoids any i18n mismatch since the backend message is English-only.
Add an i18n string (i18n.json) for the "account deactivated" message if they want it localized client-side rather than displaying the raw backend text.