diff --git a/src/Yavsc.Server/Settings/GoogleAuthSettings.cs b/src/Yavsc.Server/Settings/GoogleAuthSettings.cs index cbb5df54..58f45ee6 100644 --- a/src/Yavsc.Server/Settings/GoogleAuthSettings.cs +++ b/src/Yavsc.Server/Settings/GoogleAuthSettings.cs @@ -4,11 +4,14 @@ namespace Yavsc { public class GoogleAuthSettings { + public string ClientId { get; set; } + public string ClientSecret { get; set; } public string ApiKey { get; set; } public string BrowserApiKey { get; set; } public string GoogleServiceAccountJson { get; set; } public string GoogleWebClientJson { get; set; } + } } diff --git a/src/Yavsc/Extensions/HostingExtensions.cs b/src/Yavsc/Extensions/HostingExtensions.cs index 404e7283..9125f675 100644 --- a/src/Yavsc/Extensions/HostingExtensions.cs +++ b/src/Yavsc/Extensions/HostingExtensions.cs @@ -137,6 +137,8 @@ internal static class HostingExtensions var siteSection = builder.Configuration.GetSection("Site"); var smtpSection = builder.Configuration.GetSection("Smtp"); var paypalSection = builder.Configuration.GetSection("Authentication:PayPal"); + // OAuth2AppSettings + var googleAuthSettings = builder.Configuration.GetSection("Authentication:Google"); string? googleClientFile = builder.Configuration["Authentication:Google:GoogleWebClientJson"]; string? googleServiceAccountJsonFile = builder.Configuration["Authentication:Google:GoogleServiceAccountJson"]; @@ -157,7 +159,8 @@ internal static class HostingExtensions services.Configure(siteSection); services.Configure(smtpSection); services.Configure(paypalSection); - + services.Configure(googleAuthSettings); + services.AddRazorPages(); services.AddSignalR(o => { diff --git a/src/Yavsc/Services/GoogleApis/CalendarManager.cs b/src/Yavsc/Services/GoogleApis/CalendarManager.cs index fa09f9fc..8662ead2 100644 --- a/src/Yavsc/Services/GoogleApis/CalendarManager.cs +++ b/src/Yavsc/Services/GoogleApis/CalendarManager.cs @@ -27,6 +27,7 @@ using Google.Apis.Auth.OAuth2.Responses; namespace Yavsc.Services { + using Microsoft.Extensions.Options; using Yavsc.Models.Calendar; using Yavsc.Server.Helpers; using Yavsc.Server.Models.Calendar; @@ -46,10 +47,10 @@ namespace Yavsc.Services readonly string _client_id; readonly string _client_secret; - public CalendarManager(ILoggerFactory loggerFactory) + public CalendarManager(ILoggerFactory loggerFactory, IOptions googleAuthSettings) { - _client_id = Config.GoogleWebClientConfiguration["web:cient_id"]; - _client_secret = Config.GoogleWebClientConfiguration["web:cient_secret"]; + _client_id = googleAuthSettings.Value.ClientId; + _client_secret = googleAuthSettings.Value.ClientSecret; _logger = loggerFactory.CreateLogger(); } diff --git a/src/Yavsc/Views/Home/Index.cshtml b/src/Yavsc/Views/Home/Index.cshtml index e7f45d1d..93de3dd0 100755 --- a/src/Yavsc/Views/Home/Index.cshtml +++ b/src/Yavsc/Views/Home/Index.cshtml @@ -105,26 +105,10 @@ } -Hello Forgejo !!! -Je sais que j'ai un mauvais à priori sur "go", -mais là, bon, += Hey -le CI façon woodpecker, sous Debian, le serveur SEGFAULT, -dans la stack au "go" ... no comment. - -donc pas de CI pour le moment, -mais je garde l'option Forgejo, - -Le theme de couleur, il y est pas, -mais l'IHM, la fonction, l'´erogonomie y sont. - -J'ai du ramer un peu pour installer ma version compilée, docker, j'en veux pas, -et sans lui, la procédure en place semble cassée. - -À la place, j'ai identifié les dossiers à deployer, et tout semble ok : - -https://forgejo.pschneider.fr/[Mon nouveau SI de tickets, je l´adopte, il fonctionne, les inscriptions sont ouvertes, et libres.] +Hello !!! diff --git a/src/Yavsc/Views/Shared/_Layout.cshtml b/src/Yavsc/Views/Shared/_Layout.cshtml index eec40733..09af7af9 100644 --- a/src/Yavsc/Views/Shared/_Layout.cshtml +++ b/src/Yavsc/Views/Shared/_Layout.cshtml @@ -38,7 +38,6 @@ © 2024 - Yavsc - Privacy - diff --git a/src/Yavsc/Views/Shared/_LoginPartial.cshtml b/src/Yavsc/Views/Shared/_LoginPartial.cshtml index 572f5012..0f67ff0b 100644 --- a/src/Yavsc/Views/Shared/_LoginPartial.cshtml +++ b/src/Yavsc/Views/Shared/_LoginPartial.cshtml @@ -24,10 +24,10 @@ @if (User.IsInRole(Constants.AdminGroupName)) {