-
Notifications
You must be signed in to change notification settings - Fork 0
Description
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.luaPath where I declared plugin:
~/.config/nvim/lua/plugins/leetcode.luayou 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.
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