meteorlxy / vssue

:mailbox: A Vue-powered Issue-based Comment Plugin
https://vssue.js.org
MIT License
775 stars 105 forks source link

[Bug Report] GitHub V3 comments not showing up #98

Closed ravila4 closed 3 years ago

ravila4 commented 4 years ago

Environment

Describe the bug

When using GitHub API v3 in my setup, comments don't show up. Inspecting the console, I can see the following error messages:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.github.com/repos/ravila4/vssue.ravilabio.info/issues/8/comments?page=1&per_page=10&timestamp=1593535848373. (Reason: header ‘accept’ is not allowed according to header ‘Access-Control-Allow-Headers’ from CORS preflight response).

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.github.com/repos/ravila4/vssue.ravilabio.info/issues/8/comments?page=1&per_page=10&timestamp=1593535848373. (Reason: CORS request did not succeed).

Comments don't show up with the message: "Login to see comments". When the user logs in, he sees a 'Network error' notification.

The odd thing is that with the same setup and Github v4 API or GitLab API, everything works perfectly.

Steps To Reproduce

Here is a sample page from my Jekyll site: https://ravilabio.info/2020/04/10/reverse-engineering-abebooks-api.html

My configuration

Vssue Source

https://unpkg.com/vssue@1.4.6/dist/vssue.github.min.js

Fluid Template

https://gitlab.com/ravilabio/ravilabio.gitlab.io/-/blob/master/_includes/comments-providers/vssue.html

{%- if site.comments.vssue.clientID and
    site.comments.vssue.clientSecret and
    site.comments.vssue.repository and
    site.comments.vssue.owner -%}

  {%- include snippets/get-sources.html -%}
  {%- assign _sources = __return -%}

  <div id="vssue"></div>
  <script src='{{ _sources.vue }}'></script>
  <script src='{{ _sources.vssue.js }}'></script>
  <script>
    window.Lazyload.css('{{ _sources.vssue.css }}');
    new Vue({
      el: '#vssue',
      render: h => h('Vssue', {
        props: {
            title: '{{ page.title }}',
          options: {
              owner: '{{ site.comments.vssue.owner }}',
              repo: '{{ site.comments.vssue.repository }}',
              clientId: '{{ site.comments.vssue.clientID }}',
              clientSecret: '{{ site.comments.vssue.clientSecret }}',
          },
        }
      })
    })
  </script>

{%- endif -%}

YAML Variables

https://gitlab.com/ravilabio/ravilabio.gitlab.io/-/blob/master/_config.yml

comments:
  vssue:
    clientID    : 3261377138a7dd35c1be 
    clientSecret: a08616b5efcc0c93f123f96b8f3fe4fd81c59cc0 
    repository  : vssue.ravilabio.info
    owner       : ravila4
SilhDing commented 4 years ago

Get same problem on my blog.

http://silhding.github.io/2019/10/01/asianlang/

image

PatrickSUDO commented 4 years ago

Get same problem on my blog.

http://silhding.github.io/2019/10/01/asianlang/

image

Your problem is maybe you set the wrong link in OAuth URL in Github setting

Screen Shot 2020-08-19 at 22 17 17
SilhDing commented 4 years ago

Get same problem on my blog. http://silhding.github.io/2019/10/01/asianlang/ image

Your problem is maybe you set the wrong link in OAuth URL in Github setting

Screen Shot 2020-08-19 at 22 17 17

Oh i set it to a local URL for debugging but forgot to change it back. I have changed it but the issue still exists

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.