Skip to content

Commit 4ceb5ba

Browse files
committed
add a configuration exceptions
1 parent e793501 commit 4ceb5ba

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/KK.AspNetCore.EasyAuthAuthentication/EasyAuthAuthenticationExtensions.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public static AuthenticationBuilder AddEasyAuth(
8787
{
8888
var options = new EasyAuthAuthenticationOptions
8989
{
90-
AuthEndpoint = configuration.GetValue<string>("easyAuthOptions:AuthEndpoint"),
90+
AuthEndpoint = configuration.GetValue<string>("easyAuthOptions:AuthEndpoint"),
9191
ProviderOptions = configuration
9292
.GetSection("easyAuthOptions:providerOptions")
9393
.GetChildren()
@@ -99,6 +99,10 @@ public static AuthenticationBuilder AddEasyAuth(
9999
return providerOptions;
100100
}).ToList()
101101
};
102+
if (string.IsNullOrWhiteSpace(options.AuthEndpoint))
103+
{
104+
throw new ArgumentNullException("The 'AuthEndpoint' in the configuraiton for easy auth can't be empty! please add the setting to your configuration providers.");
105+
}
102106
return builder.AddEasyAuth(authenticationScheme, displayName, o =>
103107
{
104108
o.AuthEndpoint = options.AuthEndpoint;

0 commit comments

Comments
 (0)