From d8f253c6710cb23c632d3fc8a31d4d7d1ee0b9ff Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 11 Dec 2020 21:48:49 +0200 Subject: Authorization key is gotten from appsettings.json (AppSettings/Secret) --- API/Controllers/UserController.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'API/Controllers/UserController.cs') diff --git a/API/Controllers/UserController.cs b/API/Controllers/UserController.cs index 187b4e9..eda4a5a 100644 --- a/API/Controllers/UserController.cs +++ b/API/Controllers/UserController.cs @@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Mvc; using Data.Models.DTOs; using Microsoft.AspNetCore.Authorization; using Data.Models.Classes; +using Microsoft.Extensions.Configuration; namespace API.Controllers { @@ -16,9 +17,9 @@ namespace API.Controllers { private readonly UserService _service; - public UserController(DevHiveContext context, IMapper mapper) + public UserController(DevHiveContext context, IMapper mapper, IConfiguration configuration) { - this._service = new UserService(context, mapper); + this._service = new UserService(context, mapper, configuration.GetSection("AppSettings")); } [AllowAnonymous] -- cgit v1.2.3