leetcode.nvim icon indicating copy to clipboard operation
leetcode.nvim copied to clipboard

Blocked by LeetCode.com

Open yangrq1018 opened this issue 11 months ago • 4 comments

I can sign in normally in firefox, but the plugin is getting response like this:

<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<title>Attention Required! | Cloudflare</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" />
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" /><![endif]-->
<style>body{margin:0;padding:0}</style>
<!--[if gte IE 10]><!-->
<script>
  if (!navigator.cookieEnabled) {
    window.addEventListener('DOMContentLoaded', function () {
      var cookieEl = document.getElementById('cookie-alert');
      cookieEl.style.display = 'block';
    })
  }
</script>
<!--<![endif]-->
</head>
<body>
  <div id="cf-wrapper">
    <div class="cf-alert cf-alert-error cf-cookie-error" id="cookie-alert" data-translate="enable_cookies">Please enable cookies.</div>
    <div id="cf-error-details" class="cf-error-details-wrapper">
      <div class="cf-wrapper cf-header cf-error-overview">
        <h1 data-translate="block_headline">Sorry, you have been blocked</h1>
        <h2 class="cf-subheadline"><span data-translate="unable_to_access">You are unable to access</span> leetcode.com</h2>
      </div><!-- /.header -->
      <div class="cf-section cf-highlight">
        <div class="cf-wrapper">
          <div class="cf-screenshot-container cf-screenshot-full">

              <span class="cf-no-screenshot error"></span>
<remain truncated>

yangrq1018 avatar Mar 06 '24 14:03 yangrq1018

Although I don't know how to check the response page, I believe I'm facing the same problem. Can't login from the plugin, but no problems logging in on the website or via vscode plugin (which uses cookies as well)

ravsii avatar Mar 06 '24 16:03 ravsii

Same issue here.

HakonHarnes avatar Mar 06 '24 16:03 HakonHarnes

Although I don't know how to check the response page, I believe I'm facing the same problem. Can't login from the plugin, but no problems logging in on the website or via vscode plugin (which uses cookies as well)

@ravsii Can you run code on vscode though? I tried and I can't

Usually leetcode enables some sort of user authentication via cloudflare on high loads, that I'm pretty sure only browsers can pass. From what I've seen it only last few hours at most.

But this time it seems to be different, rather than say something along the lines of enable javascript it now says to enable cookies, lets hope it's not permanent.

kawre avatar Mar 06 '24 17:03 kawre

@kawre I believe it's just cloudflare blocking the request to due the missing user-agent header. Works for me with PR #70.

HakonHarnes avatar Mar 06 '24 17:03 HakonHarnes