feat: Implement GitHub OAuth (#72)

* implement GitHub OAuth

* fmt and clippy

* add secrets for GitHub App in workflow

* fix env vars

* use device flow for login instead of callback for better security, add email and username to posthog analytics

* cleanup

* add user details to sentry context

* fixes after rebase

* feedback fixes

* do not allow to press esc to hide github popup

* use oauth app to get user token with full repo access

* use PAT token as a backup for creating PRs

* update github signin box text

* update sign in box styling

* fmt

---------

Co-authored-by: Gabriel Gordon-Hall <ggordonhall@gmail.com>
This commit is contained in:
Anastasiia Solop
2025-07-08 19:32:23 +02:00
committed by GitHub
parent 5368d827ae
commit dedee0f298
17 changed files with 1041 additions and 90 deletions

View File

@@ -9,6 +9,12 @@ fn main() {
if let Ok(api_endpoint) = std::env::var("POSTHOG_API_ENDPOINT") {
println!("cargo:rustc-env=POSTHOG_API_ENDPOINT={}", api_endpoint);
}
if let Ok(api_key) = std::env::var("GITHUB_APP_ID") {
println!("cargo:rustc-env=GITHUB_APP_ID={}", api_key);
}
if let Ok(api_endpoint) = std::env::var("GITHUB_APP_CLIENT_ID") {
println!("cargo:rustc-env=GITHUB_APP_CLIENT_ID={}", api_endpoint);
}
// Create frontend/dist directory if it doesn't exist
let dist_path = Path::new("../frontend/dist");