From 0ced368698907bd63b31ec5319378b8a792fae24 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 11:40:52 +0000 Subject: [PATCH] Replace GitHub SSO with Facebook SSO Co-authored-by: edgeofsanity76 <79632647+edgeofsanity76@users.noreply.github.com> --- BudgetApp/BudgetApp.csproj | 1 + BudgetApp/Components/Pages/Login.razor | 2 +- BudgetApp/Program.cs | 18 +++++------------- BudgetApp/appsettings.json | 2 +- Dockerfile | 4 ++-- 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/BudgetApp/BudgetApp.csproj b/BudgetApp/BudgetApp.csproj index f2e15ab..3cba5e6 100644 --- a/BudgetApp/BudgetApp.csproj +++ b/BudgetApp/BudgetApp.csproj @@ -13,6 +13,7 @@ + diff --git a/BudgetApp/Components/Pages/Login.razor b/BudgetApp/Components/Pages/Login.razor index 6b94e9a..321a7f1 100644 --- a/BudgetApp/Components/Pages/Login.razor +++ b/BudgetApp/Components/Pages/Login.razor @@ -113,7 +113,7 @@ { "Google" => new MarkupString(""), "Microsoft" => new MarkupString(""), - "GitHub" => new MarkupString(""), + "Facebook" => new MarkupString(""), _ => new MarkupString("") }; diff --git a/BudgetApp/Program.cs b/BudgetApp/Program.cs index 607f44a..a3dac96 100644 --- a/BudgetApp/Program.cs +++ b/BudgetApp/Program.cs @@ -58,21 +58,13 @@ if (!string.IsNullOrEmpty(microsoftSection["ClientId"]) && !string.IsNullOrEmpty }); } -var githubSection = builder.Configuration.GetSection("Authentication:GitHub"); -if (!string.IsNullOrEmpty(githubSection["ClientId"]) && !string.IsNullOrEmpty(githubSection["ClientSecret"])) +var facebookSection = builder.Configuration.GetSection("Authentication:Facebook"); +if (!string.IsNullOrEmpty(facebookSection["ClientId"]) && !string.IsNullOrEmpty(facebookSection["ClientSecret"])) { - authBuilder.AddOAuth("GitHub", "GitHub", options => + authBuilder.AddFacebook(options => { - options.ClientId = githubSection["ClientId"]!; - options.ClientSecret = githubSection["ClientSecret"]!; - options.AuthorizationEndpoint = "https://github.com/login/oauth/authorize"; - options.TokenEndpoint = "https://github.com/login/oauth/access_token"; - options.UserInformationEndpoint = "https://api.github.com/user"; - options.CallbackPath = "/signin-github"; - options.Scope.Add("user:email"); - options.ClaimActions.MapJsonKey(System.Security.Claims.ClaimTypes.NameIdentifier, "id"); - options.ClaimActions.MapJsonKey(System.Security.Claims.ClaimTypes.Name, "login"); - options.ClaimActions.MapJsonKey(System.Security.Claims.ClaimTypes.Email, "email"); + options.ClientId = facebookSection["ClientId"]!; + options.ClientSecret = facebookSection["ClientSecret"]!; }); } diff --git a/BudgetApp/appsettings.json b/BudgetApp/appsettings.json index 96ab433..264e69b 100644 --- a/BudgetApp/appsettings.json +++ b/BudgetApp/appsettings.json @@ -25,7 +25,7 @@ "ClientId": "", "ClientSecret": "" }, - "GitHub": { + "Facebook": { "ClientId": "", "ClientSecret": "" } diff --git a/Dockerfile b/Dockerfile index 8262063..5237ce2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,8 +32,8 @@ ENV Authentication__Google__ClientId="" \ Authentication__Google__ClientSecret="" \ Authentication__Microsoft__ClientId="" \ Authentication__Microsoft__ClientSecret="" \ - Authentication__GitHub__ClientId="" \ - Authentication__GitHub__ClientSecret="" + Authentication__Facebook__ClientId="" \ + Authentication__Facebook__ClientSecret="" VOLUME ["/app/data"]