Skip to content

Commit

Permalink
Rename AuthenticatonSchemes to AuthenticationSchemes (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
bytefish authored Nov 14, 2024
1 parent 485e7d4 commit 03640dd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Todo.Web/Server/AuthApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static RouteGroupBuilder MapAuth(this IEndpointRouteBuilder routes)
group.MapGet("signin/{provider}", async (string provider, AuthClient client, HttpContext context) =>
{
// Grab the login information from the external login dance
var result = await context.AuthenticateAsync(AuthenticatonSchemes.ExternalScheme);
var result = await context.AuthenticateAsync(AuthenticationSchemes.ExternalScheme);

if (result.Succeeded)
{
Expand All @@ -85,7 +85,7 @@ public static RouteGroupBuilder MapAuth(this IEndpointRouteBuilder routes)
}

// Delete the external cookie
await context.SignOutAsync(AuthenticatonSchemes.ExternalScheme);
await context.SignOutAsync(AuthenticationSchemes.ExternalScheme);

// TODO: Handle the failure somehow

Expand Down
6 changes: 3 additions & 3 deletions Todo.Web/Server/Authentication/AuthenticationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static WebApplicationBuilder AddAuthentication(this WebApplicationBuilder
authenticationBuilder.AddCookie();

// This is the cookie that will store the user information from the external login provider
authenticationBuilder.AddCookie(AuthenticatonSchemes.ExternalScheme);
authenticationBuilder.AddCookie(AuthenticationSchemes.ExternalScheme);

// Add external auth providers based on configuration
//{
Expand Down Expand Up @@ -60,7 +60,7 @@ public static WebApplicationBuilder AddAuthentication(this WebApplicationBuilder
// This will save the information in the external cookie
if (options is RemoteAuthenticationOptions remoteAuthenticationOptions)
{
remoteAuthenticationOptions.SignInScheme = AuthenticatonSchemes.ExternalScheme;
remoteAuthenticationOptions.SignInScheme = AuthenticationSchemes.ExternalScheme;
}
else if (options is Auth0WebAppOptions auth0WebAppOptions)
{
Expand Down Expand Up @@ -93,7 +93,7 @@ static void SetAuth0SignInScheme(WebApplicationBuilder builder)
{
// The Auth0 APIs don't let you set the sign in scheme, it defaults to the default sign in scheme.
// Use named options to configure the underlying OpenIdConnectOptions's sign in scheme instead.
o.SignInScheme = AuthenticatonSchemes.ExternalScheme;
o.SignInScheme = AuthenticationSchemes.ExternalScheme;
});
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Todo.Web.Server;

public class AuthenticatonSchemes
public class AuthenticationSchemes
{
// This is the scheme used to store login information from external providers
public static string ExternalScheme => "External";
Expand Down
2 changes: 1 addition & 1 deletion Todo.Web/Server/Authentication/ExternalProviders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private async Task<string[]> GetProviderNamesAsyncCore()
{
// We're assuming all schemes that aren't cookies are social
if (s.Name == CookieAuthenticationDefaults.AuthenticationScheme ||
s.Name == AuthenticatonSchemes.ExternalScheme)
s.Name == AuthenticationSchemes.ExternalScheme)
{
continue;
}
Expand Down

0 comments on commit 03640dd

Please sign in to comment.