diff options
Diffstat (limited to 'API/Extensions')
| -rw-r--r-- | API/Extensions/ConfigureJWT.cs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/API/Extensions/ConfigureJWT.cs b/API/Extensions/ConfigureJWT.cs index 1de2aa5..22ada98 100644 --- a/API/Extensions/ConfigureJWT.cs +++ b/API/Extensions/ConfigureJWT.cs @@ -12,11 +12,17 @@ namespace API.Extensions { public static void JWTConfiguration(this IServiceCollection services, IConfiguration configuration) { - services.AddSingleton<JWTOptions>( - new JWTOptions(configuration.GetSection("AppSettings").GetSection("Secret").Value)); + services.AddSingleton(new JWTOptions(configuration + .GetSection("AppSettings") + .GetSection("Secret") + .Value)); // Get key from appsettings.json - var key = Encoding.ASCII.GetBytes(configuration.GetSection("AppSettings").GetSection("Secret").Value); + var key = Encoding.ASCII.GetBytes(configuration + .GetSection("AppSettings") + .GetSection("Secret") + .Value); + // Setup Jwt Authentication services.AddAuthentication(x => { |
