NirmalScaria / le-git-graph

Browser extension to add git graph to GitHub website.
https://chrome.google.com/webstore/detail/le-git-graph-commits-grap/joggkdfebigddmaagckekihhfncdobff
MIT License
3.13k stars 16 forks source link

Stuck on authorisation page for organisation's private repos #42

Closed krogedal closed 1 year ago

krogedal commented 1 year ago

I've set this extension up in my browser, and it works great for both my private and public repositories, but with the private repositories of my organisation, it just keeps asking me for authorisation. Currently circling this loop:

I've tried this with both Chrome and Firefox.

Is this a bug or a policy setting in the organisation that needs to be checked? I'm the owner, so should be able to sort it if so.

ben-hirsh-igb commented 1 year ago

same here, tried to make a PAT but am getting errors in the chrome console:


caught (in promise) TypeError: Cannot read properties of undefined (reading 'repository')
    at getCommitDetails (showCommits.js:113:33)
    at async showCommits (showCommits.js:151:27)
    at async sortCommits (sortCommits.js:61:5)
    at async fetchCommits (fetchCommits.js:153:9)
    at async HTMLAnchorElement.openCommitsTab (openCommitsTab.js:60:9)
ben-hirsh-igb commented 1 year ago

Yes got it to work with a Personal access token. Will find out what permissions it needs

ben-hirsh-igb commented 1 year ago

Okay fixed it. Create a personal access token with the repo | Full control of private repositories (and every sub permission below it) enabled. Add the personal access token to the plugin by clicking the arrow next to the authorize button and select 'custom'

krogedal commented 1 year ago

Thanks, that worked for me as well. Any idea on why the normal authorisation process won't work?

In the meantime, could be worth adding this extra setup step to the readme.

ben-hirsh-igb commented 1 year ago

so I found that I probably didn't authorize the app with GitHub via the email that was sent. So i've revoked the PAT i made and re authorized the app with the way you described in the original post. Now it works!

NirmalScaria commented 1 year ago

Seems like organisation repos' OAuth access is managed by the organisations. There is no way the user could directly authorise an OAuth app to access the repo. The only way is to either request the organisation to provide access to the repo, or to use a PAT. PAT seems like the way to go for, since the extension is targeted more towards individual use than being implemented for a whole organisation. . I have added instructions in the extension as well as README on how to handle this. It has been released with version 1.1.5. Thank you, @krogedal , @ben-hirsh-igb