Problem with new comment system
Sparkenstein opened this issue · comments
Hi,
I have created a new application on github with following settings:
application name: myblog
homepage url: myblog.com
application description : xyz
authorization callback url: myblog.com
and I have added this config in my .config.js
comment: {
clientID: 'abcdxyz',
clientSecret: 'xyzbcd',
repo: 'https://www.github.com/Sparkenstein',
owner: 'Sparkenstein',
admin: ['Sparkenstein'],
perPage: 5,
id: Math.random()*10, // Don't know what to give here
distractionFreeMode: false
}
I am having Error while developing like
Error: Not Found
What is going wrong? am I missing something? and what id
field supposed to hold?
The repo field in your config.js could be a repo name, such like blog-comment
, not an url link
I have made changes as you suggested. The comment section is still not working, after debugging a bit, I found out that the request for repos issues has a wrong header field that's why it's giving me 401.
I have removed id field to keep the default value of 'location.href'.
Also, if I don't want to use comment system, how do I disable it? removing the comment {} object from config.js file is not removing the comments section at the bottom of the page.
-
What's
token: null
meaning the comment system could not get your github accessToken, please check your github token is not existed or does it has the repo permission , like this:
-
Sorry, at the last version (3.0.2), I don't remove the comment if the comment object dont's exist in config. But, I fix it in version 3.0.3 with commit bdba9, please upgrade to 3.0.3.
Second problem solved after updating. The first one still there. I checked my access token had the access to public repositories. The token is still null. What else can be the reason?
What's your comment config now? Please described as detailed as possible
Very sorry for the late reply, I was busy with my work.
Here are the steps I did from start:
- I created a new Oauth application from this url. I gave homepage URL and authorization callback both as my blogs URL fosslife
- I got a clientID and client secret after registering.
- Then I added clientID and clientSecrete in my themeConfig, in comment {} section.
the comment object looks like this:
comment: {
clientID: 'xyz',
clientSecret: 'abc',
repo: 'Blogs',
owner: 'Sparkenstein',
admin: ['Sparkenstein'],
perPage: 5,
distractionFreeMode: false
}
Then I deployed the site with this config, and visited the site. Now I had below message there:
Related Issues not found
Please contact @Sparkenstein to initialize the comment
Then I logged in with github
from the button down to this message, gave the access to my account as it asked. the application then redirected to my homepage as usual. but now I got this message at the bottom:
Error: Bad credentials.
I inspected the network tab, it had the same error we discussed. Authorization: token null
and response was
{
"message": "Bad credentials",
"documentation_url": "https://developer.github.com/v3"
}
Sorry for the confusion,
it looks like the token null
issue only appears when we give access to the Oauth application and get redirected to the homepage. When I got redirected, after getting the error I mentioned above, I hard refreshed the page with ctrl + F5
and request worked. the comment system now working normally. closing this issue.
Still if the issue on ourside, i.e. when user gets redirected, you might wanna check the code! :D thank you for your support. 🎉