Skip to content

UI/UX: Auth check failure path provides no actionable UI error state#266

Open
Nam0101 wants to merge 1 commit into
anonfaded:masterfrom
Nam0101:contribai/fix/ui/auth-check-failure-path-provides-no-acti
Open

UI/UX: Auth check failure path provides no actionable UI error state#266
Nam0101 wants to merge 1 commit into
anonfaded:masterfrom
Nam0101:contribai/fix/ui/auth-check-failure-path-provides-no-acti

Conversation

@Nam0101

@Nam0101 Nam0101 commented Apr 1, 2026

Copy link
Copy Markdown

Hi there! 👋

While going through the codebase, I noticed a minor opportunity for improvement regarding app/src/main/assets/web/js/services/AuthService.js.

Context:
checkAuthStatus() maps network/server failures to { authEnabled: false, authenticated: false }. This makes temporary connectivity issues indistinguishable from real auth-disabled state, so UI layers cannot show meaningful error feedback, retry affordances, or offline messaging. Users can be misled into thinking auth was turned off instead of failed to verify.

Proposed fix:
Return a structured error state (or throw) so UI can render an explicit error message/retry state.
Example:

async checkAuthStatus() {
try {
const response = await fetch('/auth/check', {
method: 'GET',
headers: this.getAuthHeaders()
});

    if (!response.ok) {
        return {
            authEnabled: this.authEnabled,
            authenticated: this.authenticated,
            error: `AUTH_CHECK_HTTP_${response.status}`
        };
    }

    const data = await response.json();
    this.authEnabled = !!data.authEnabled;
    this.authenticated = !!data.authenticated;

    return { authEnabled: this.authEnabled, authenticated: this.authenticated, error: null };
} catch (e) {
    return {
        authEnabled: this.authEnabled,
        authenticated: this.authenticated,
        error: 'AUTH_CHECK_NETWORK_ERROR'
    };
}

}

Files touched:

  • app/src/main/assets/web/js/services/AuthService.js (modified)

(Note: Tested the changes locally to ensure everything works as expected. Let me know if you need any adjustments, happy to help!)


NamNV
📍 Hanoi, Vietnam
📧 nam.nv205106@gmail.com

`checkAuthStatus()` maps network/server failures to `{ authEnabled: false, authenticated: false }`. This makes temporary connectivity issues indistinguishable from real auth-disabled state, so UI layers cannot show meaningful error feedback, retry affordances, or offline messaging. Users can be misled into thinking auth was turned off instead of failed to verify.


Affected files: AuthService.js

Signed-off-by: Nguyen Van Nam <nam.nv205106@gmail.com>
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.

1 participant