imsun / gitment

A comment system based on GitHub Issues.
https://imsun.github.io/gitment/
MIT License
4.06k stars 350 forks source link

gh-oauth.imsun.net 证书失效 #199

Open asnowwolf opened 4 years ago

asnowwolf commented 4 years ago

登录之后控制台出现如下错误:

POST https://gh-oauth.imsun.net/ net::ERR_CERT_AUTHORITY_INVALID

无法进行后续操作

stopspazzing commented 4 years ago

Same issue here.

stopspazzing commented 4 years ago

Problem is on Line #3415 of gitment.browser.js: _utils.http.post('https://gh-oauth.imsun.net/', { to _utils.http.post('https://cors-anywhere.herokuapp.com/https://github.com/login/oauth/access_token', {

He was using gh-oauth.imsun.net as a CORS proxy to bypass the issue of the no accept headers issue. if you replace it with the above code it will work, but now spits out the error validation problem, which I believe is solved by a pull request. His website has an expired ssl cert which doesnt allow ssl websites from accessing it. So I bypassed his proxy with a well know CORS proxy above. While it is a solution to the problem, still passing keys to an uncontrolled proxy. FYI

xiaozongyang commented 3 years ago

same issue here

shunhua commented 3 years ago

一样的问题 都没解决吗?

baifachuan commented 2 years ago

修改gitment.browser.js文件的3416行将https://gh-oauth.imsun.net/ 换成: https://baifachuan.com:8443/

我自己重新搭建了一个这个代理服务。纯代理。

baifachuan commented 2 years ago

修改gitment.browser.js文件的3416行将https://gh-oauth.imsun.net/替换成:https://baifachuan.com:8443/

该服务器代码在:https://github.com/imsun/gh-oauth-server,不会记录任何信息,我也是自己的博客使用:https:www.baifachuan.com,因为该服务器需要https,所以构建在自己的服务下,需要的可以使用。修改后的代码为:

      _utils.http.post('https://www.baifachuan.com:8443', {
        code: code,
        client_id: client_id,
        client_secret: client_secret
      }, '').then(function (data) {
        _this.accessToken = data.access_token;
        _this.update();
      }).catch(function (e) {
        _this.state.user.isLoggingIn = false;
        alert(e);
      });
    } else {
      this.update();
    }

update the gitment.browser.js file replace https://gh-oauth.imsun.net/ to https://baifachuan.com:8443/. This service won't record or store anything. It only attaches a CORS header to that request and provides proxy. So that users can login in the frontend without any server-side implementation.