Skip to content

Feature Request - Login to LeetCode using Browser Instead of Cookies #2

@ravindran-dev

Description

@ravindran-dev

Description

Currently, the LeetCode integration in the dashboard relies on manually copying browser cookies (LEETCODE_SESSION + csrftoken). This approach is fragile and gives "Bad CSRF token format" error.

Proposal:

Introduce "Login via Browser" by opening the LeetCode sign-in page in the user’s default web browser and automatically capturing the authentication token afterward similar to how gh auth login and VSCode LeetCode extension handle authentication.

Expected Behavior

  • User selects: Sign in (via Browser)

  • Neovim launches browser for login

  • After successful login - The plugin automatically extracts and stores secure session keys locally

  • No manual cookie copying required

Benefits

  • More secure authentication flow

  • No need to know how cookies work

  • Removes accidental session expiry frustration

  • Works cross-platform

  • UX similar to popular developer tools

Additional Notes

I have tried making it fulfill using

/.config/nvim/lua/plugins/leetcode.lua
~/.config/nvim/lua/core/dashboard.lua
~/.config/nvim/lua/core/leetcode_browser.lua
~/.config/nvim/lua/core/leetcode_cookie.lua

Path where I declared plugin:

~/.config/nvim/lua/plugins/leetcode.lua

you can work on these files to resolve this issue

Screenshots for reference:

I need to add Sign in through Browser option here in the leetcode plugin along with the Sign in through cookies.

Image

Checklist

  • This request aligns with improving UX and security

  • Login via cookie should remain optional

  • No existing issue provides this full feature

  • Browser login should be platform compatible in all os - Linux/Mac/Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions