imsun / gitment

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

Error: Comments Not Initialized #81

Open Aszzo opened 6 years ago

Aszzo commented 6 years ago

一直报错:Error: Comments Not Initialized,登陆后会跳转到首页,并且在地址后面拼接?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fv3%2Foauth%2F%23redirect-uri-mismatch这样一堆参数。配置就是完全按照文档中的方法来的。捣鼓一下午了,在注册OAuth documentation的时候Homepage URLAuthorization callback URL都是线上的链接。求救。。。

mowatermelon commented 6 years ago

这个你要登录你的github帐号之后,就可以对这个页面评论框进行初始化了

drrui commented 6 years ago

@mowatermelon 点击登陆,会刷新当前页。。。这个是哪里错了呢。。。

mowatermelon commented 6 years ago

不太明白你说的点。 1 你要把本地需要加载的jscss参数都配置好,还有oathapp申请做好。 2 如果你在oathapp申请的时候配置的是你name.github.io作为主页地址和回调地址,则将本地仓库文件推到github在线仓库地址,如果是你自己的域名,推送到对应的服务器地址。 3 访问对应的网址比如我的就是https://mowatermelon.github.io,然后访问对应的网址,随便选择一篇博客进去。 4 点击评论框中的Login,进行用户登录,如果你当前已经开了github,并且已经在后台登录,这边自动登录,这个时候会自动刷新页面,并且原本Login with GitHub的地方变为Logout, 5 如果是刚写的博客,这边会提示请初始化评论框,你点击之后,原本提示请初始化评论框的地方,会变为目前还没有评论,并且你会在你对应的仓库下发现新建了一个issue。 6 你的意思是页面刷新了,但是登录状态没有变吗,还是不能初始化评论框吗?

Aszzo commented 6 years ago

@mowatermelon 一开始使用的是name.github.io作为主页的地址和回调地址,这个是没有出现问题的。可以正常初始化,正常的评论。后来将自己购买的阿里云的域名解析到github pages,oatapp申请时使用的是我自己的域名,client_idclient_secret也都更新成最新的了,然后就会出现问题。显示Error: Comments Not Initialized,点击login,如果我已经在后台登录过github,页面会直接跳转到博客首页,并且地址后面拼接一段错误参数,例如:www.example.com?error=redirect_uri_mismatch&error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdeveloper.github.com%2Fv3%2Foauth%2F%23redirect-uri-mismatch,如果后台未登录github则会让你先输入github账号密码再跳转到示例中的链接。我觉得问题应该是不是出在回调地址那里,但是我检查好几遍都没发现什么错误

mowatermelon commented 6 years ago

@Aszzo 就是改成以下配置,这边评论框就不能初始化了?

#  githubID: #{your-github-name}
#  repo: #{your-callback-url}
#  ClientID: #{your-ClientID}
#  ClientSecret: #{your-ClientSecret}

感觉你这个错误redirect-uri-mismatch是验证oath的时候失败了。

Aszzo commented 6 years ago

@mowatermelon oath我也创建好几次了,还是不行,我都开始怀疑人生了,是不是我注册的域名有毒:rage:,我最终还是换了个评论系统

mowatermelon commented 6 years ago

@Aszzo 我还没有换成个人域名,所以只能猜测,这个会不会是只能有一个唯一的oathapp,如果多了,有点匹配不上,日常胡说,感觉自己都不能信这个,你最后换成什么评论了?

Aszzo commented 6 years ago

@mowatermelon 一开始使用友言,这货特别慢。现在用的来必力,感觉还不错,用段时间看看会不会有问题

drrui commented 6 years ago

@Aszzo 和你一样的问题。。。点击登陆会跳到首页,

Aszzo commented 6 years ago

@drrui 我尝试了好多办法还是没解决掉,,,:triumph:

qytang326 commented 6 years ago

应该是OATH的域名回调错了,全部写成你的主页地址

Zephyroam commented 6 years ago

@drrui @Aszzo image

改成新的域名即可

pplmx commented 6 years ago

@Aszzo 同样的问题,点击login,就调回callback url了

pplmx commented 6 years ago

@Aszzo 换成来必力了..................

kuhung commented 6 years ago

我解决了,先在你的个人页面点一下github的那个黑图标,认证之后就可以init了。亲测有效,可以试试 。http://kuhungio.me/2017/11/21/yysGAN/

GeneralLi95 commented 6 years ago

@Aszzo 和你一样的问题啊,同样用也是没有解决。

xuepro commented 6 years ago

我也是同样的问题: 点击登陆,会刷新当前页。。。这个是哪里错了呢。。

drrui commented 6 years ago

我后来的解决方法是在需要评论的页面单独加入该功能,也就是说每次都写,而不是做成global的形式。就成了。

BenfenYU commented 6 years ago

@Aszzo 今天我也遇到了和你一样的问题,按照文档在每个对应的位置填写配置. 最后我是这样解决的; 进入github首页,进入修改OAuth apps的信息的页面, 我的homepage和callbackurl都是{{http://username.github.io}}, 我把原来的url由'http://username.github.io'改为'https://username.github.io' 再发布博客,居然出现了initialize的按钮,然后就成功了. 我还以为我无意中修改了别的配置,然后又把https改成http,果然失败. 真神奇.

ink-bottle commented 5 years ago

我的登陆之后显示已经授权,但是刷新之后就404了,进入文章界面还是不能评论,依然Error: Comments Not Initialized

Franklin-Qi commented 5 years ago

回调地址为:https://github.com/yusq77/yusq77.github.io, Error: Comments Not Initialized, 登录后就跳到博客的GitHub地址了

Meoworu commented 5 years ago

完犊子啦搞不定