Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: gitHub authentication to the application using GitHub's Device Flow O… #408

Open
wants to merge 43 commits into
base: main
Choose a base branch
from

Conversation

emcconnell
Copy link
Collaborator

@emcconnell emcconnell commented Nov 25, 2024

When the user clicks on the clone or push buttons in the UI they will be presented with the ability to launch the GitHub flow to create an auth token that will be stored in local storage. This makes cloning and pushing to private repos possible and follows best practices by GitHub. There are other enhancements that can be added to this but IMP this looks and works well.

This pull request introduces several significant changes to the app/components/chat and related files to enhance the Git cloning feature. The most important changes include the addition of a Git clone modal, updates to the GitCloneButton component, and the creation of a spinner for the cloning process.

Enhancements to Git cloning feature:

Minor improvements:

Other changes:

Setup Requirements
Create a GitHub OAuth App:

Go to GitHub Settings > Developer Settings > OAuth Apps > New OAuth App
Fill in:
Application name: "Bolt Local" (or your preferred name)
Homepage URL: Your application URL
No callback URL needed (using Device Flow)
Environment Variables:
VITE_GITHUB_CLIENT_ID=Ov23livn63c7k1xXt9ke

389336454-3f6ec46e-1058-4b55-b7a9-a0557ae60a48

@emcconnell
Copy link
Collaborator Author

emcconnell commented Nov 25, 2024

SEE NEWER VIDEO LINKED BELOW

@coleam00
Copy link
Collaborator

This is FANTASTIC, thanks @emcconnell! I'll take a look at this tonight!

@coleam00
Copy link
Collaborator

Nice implementation @emcconnell! I love it!

Could you expand more on what this will be used for? Is this more to get ready for further integrations with Git like importing repos? It seems this sets up GitHub authentication but doesn't necessarily add a new "feature" to oTToDev. Or maybe I am missing something obvious.

But either way this is super important to have so thank you!

@emcconnell
Copy link
Collaborator Author

@coleam00

Is this more to get ready for further integrations with Git like importing repos?

Yes, that's correct. To merge now may be confusing as it doesn't add anything except auth to github. Also, @thecodacus is working in this direction also and not sure where we will land. If we wanted this, I could add some functionality for now like enhancing the current github push by using this auth flow. I only had time for this part and knew we had some open ideas on how to approach but wanted to toss what I had time for into the ring. So, maybe @wonderwhy-er or @thecodacus have some input on what to do with it for now.

@thecodacus
Copy link
Collaborator

this looks great @emcconnell , the git integration i am working on also will require a authentication if we want to clone a private repo. so this will really help for cloning gihub based repos. this is great 👍

@dustinwloring1988 dustinwloring1988 added the enhancement New feature or request label Dec 2, 2024
@emcconnell
Copy link
Collaborator Author

Added this to the features as a "utility" feature. This video will explain it best: https://www.youtube.com/watch?v=envCOTYCBVI

Can we merge this? Or do we have specific comments? I realize we have a place to paste user and token in settings/connection.

@emcconnell emcconnell changed the title GitHub authentication to the application using GitHub's Device Flow O… (feat) GitHub authentication to the application using GitHub's Device Flow O… Dec 20, 2024
@emcconnell emcconnell changed the title (feat) GitHub authentication to the application using GitHub's Device Flow O… feat: GitHub authentication to the application using GitHub's Device Flow O… Dec 20, 2024
@emcconnell emcconnell changed the title feat: GitHub authentication to the application using GitHub's Device Flow O… feat: gitHub authentication to the application using GitHub's Device Flow O… Dec 20, 2024
@emcconnell emcconnell marked this pull request as draft December 20, 2024 01:34
@emcconnell
Copy link
Collaborator Author

See latest video here: https://youtu.be/Mq_eMsKszj4?si=uVnGzxqFUlmUlH2Z

@emcconnell emcconnell marked this pull request as ready for review December 22, 2024 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants