Skip to content

Commit b1f889f

Browse files
hickfordMatthew John Cheetham
andauthored
Apply suggestions from code review
Co-authored-by: Matthew John Cheetham <[email protected]>
1 parent c512d1b commit b1f889f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/shared/Core/GenericOAuthConfig.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ public static bool TryGet(ITrace trace, ISettings settings, InputArguments input
1414
Uri tokenEndpointUri = null;
1515
var remoteUri = input.GetRemoteUri();
1616

17-
if (input.WwwAuth.Any(x => x.Contains("Basic realm=\"Gitea\"")))
17+
if (input.WwwAuth.Any(x => x.Contains("Basic realm=\"Gitea\"", StringComparison.OrdinalIgnoreCase)))
1818
{
1919
trace.WriteLine($"Using universal Gitea OAuth configuration");
2020
// https://docs.gitea.com/next/development/oauth2-provider?_highlight=oauth#pre-configured-applications
21-
config.ClientId = "e90ee53c-94e2-48ac-9358-a874fb9e0662";
22-
// https://docs.gitea.com/next/development/oauth2-provider?_highlight=oauth#endpoints
23-
authzEndpointUri = new Uri(remoteUri, "/login/oauth/authorize");
24-
tokenEndpointUri = new Uri(remoteUri, "/login/oauth/access_token");
25-
config.RedirectUri = new Uri("http://127.0.0.1");
21+
config.ClientId = WellKnown.GiteaClientId;
22+
authzEndpointUri = new Uri(remoteUri, WellKnown.GiteaAuthzEndpoint);
23+
tokenEndpointUri = new Uri(remoteUri, WellKnown.GiteaTokenEndpoint);
24+
config.RedirectUri = WellKnown.LocalIPv4RedirectUri;
2625
}
2726

2827
if (settings.TryGetSetting(

0 commit comments

Comments
 (0)