Skip to content

expired token check happens after fetch in loadUserData #964

@payalrvs3

Description

@payalrvs3

In frontend/src/features/auth.js, the loadUserData function fetches /api/users/ using user.access_token before checking if the user is null or expired.

Problem

If user is null, accessing user.access_token throws a TypeError immediately. If the token is expired, the fetch runs with a stale token
causing a 401 response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions