|
|
@@ -7,8 +7,8 @@ public class AuthenticationModule : IAppConfigurationModule
|
|
|
{
|
|
|
public void ConfigureServices(IServiceCollection services, IConfigurationRoot config)
|
|
|
{
|
|
|
- var authOptions = new AuthOptions();
|
|
|
- config.GetSection("Auth").Bind(authOptions);
|
|
|
+ // GetRequiredSection throws an exception if the section is missing, so authOptions always has a value
|
|
|
+ var authOptions = config.GetRequiredSection(AuthSettings.SectionName).Get<AuthSettings>()!;
|
|
|
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
|
|
|
.AddJwtBearer(options =>
|
|
|
{
|