Closed BrainBuzzer closed 4 years ago
Try taking on this on both frontend and backend. It might be a good exercise to know how the flow should be.
Definitely.
Here's how I imagine it:
/connect_github
and there's a nice simple UI to choose between public/private scope with a small description for eachConnect with GitHub
step on frontend, the user gets an option to include private repos via a dropdown after clicking or a toggle switch. This will toggle the redirect link between /connect_github?token=...&repos_scope=full
and /connect_github?token=...&repos_scope=public
/connect_github
./auth/github?repos_scope=public
or /auth/github?repos_scope=full
. It would default to public
in case the user comes directly to /auth/github
with no or some random querystringThis one still involved getting to the backend to choose. Instead, backend only redirects the user to GitHub connection page directly. To do so, have a toggle on frontend that allows user to choose between selecting private repos and public repos. The link will change as per the toggle where connect_github will be passed additional scope if the user says ask for private repos too.
Okay that works too. So for the first point, I'll just add the ui on the frontend and then the redirect to /connect_github
to already have repos_scope=full or repos_scope=public
.
Due to the current permissions requested on the GitHub end of the application(read and write access to private and public repos) many people don't connect their GitHub. So there needs to be a switch at connect_github endpoint which allows users to set the scope to just
public_repo
rather thanrepo
unless requested explicitly.