Skip to content

Issue: Improve Username Retrieval Logic #354

Closed

Description

@Yashaswini-K-P

Problem
The current method of parsing the username via URL path segments (window.location.pathname.split("/")) is fragile. It breaks if the URL structure changes, if there is a trailing slash, or if new sub-paths are added to your routing.

Requirement
Decouple the username from the URL entirely. You need a reliable "source of truth" for the current user's identity that the frontend can read regardless of how the URL is structured.

What is needed

  1. Inject the username: Pass the username from your backend into the HTML <head> using a <meta> tag when the page loads.
  2. Centralize access: Create a single, small helper function that reads this meta tag.
  3. Replace old logic: Remove the URL parsing logic from all your individual files (ranks.js, historical-graphs.js, etc.) and replace it with a call to this new helper function.

Activity

  1. github-actions commented on Jul 20, 2026

    @github-actions
    Contributor

    Thank you for opening an issue.

    Please review our CONTRIBUTING.md guidelines before getting started.

    A maintainer will review this issue shortly. If you would like to work on the issue yourself, please leave a comment requesting assignment.

    Issue Assignment Policy

    • The issue creator is given the first priority to work on their issue.
    • If the creator declines or does not request assignment, the issue will be assigned to others in the order of requests received.
    • Please do not submit PRs or begin work until you are officially assigned.

    Note: This project is currently maintained by a solo maintainer, so reviews, assignments, and responses may sometimes take a little time. Thanks for your patience.

  2. TanCodeX commented on Jul 25, 2026

    @TanCodeX

    @jagdish-15 Please assign me this under gssoc.

  3. added
    level:advanced
    Frontend
    on Jul 28, 2026
  4. github-actions commented on Aug 12, 2026

    @github-actions
    Contributor

    This issue has been inactive for 14 days and has been marked as stale. To keep this issue open, please leave a comment.

  5. Yashaswini-K-P commented on Aug 12, 2026

    @Yashaswini-K-P
    ContributorAuthor

    working

  6. github-actions commented on Aug 27, 2026

    @github-actions
    Contributor

    This issue has been inactive for 14 days and has been marked as stale. To keep this issue open, please leave a comment.

  7. Yashaswini-K-P commented on Aug 27, 2026

    @Yashaswini-K-P
    ContributorAuthor

    linked pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Frontendlevel:advancedtype:performance

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions