From 3abbc13bcc55e68740564457fff455c849a1cd8a Mon Sep 17 00:00:00 2001 From: transtrike Date: Sun, 13 Dec 2020 12:29:02 +0200 Subject: Ordering Models --- API/Service/RoleService.cs | 27 +++++++++++++++++++++++++++ API/Service/UserService.cs | 4 ++-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 API/Service/RoleService.cs (limited to 'API/Service') diff --git a/API/Service/RoleService.cs b/API/Service/RoleService.cs new file mode 100644 index 0000000..82c89b8 --- /dev/null +++ b/API/Service/RoleService.cs @@ -0,0 +1,27 @@ +using System; +using System.Threading.Tasks; +using API.Database; +using Microsoft.AspNetCore.Mvc; + +namespace API.Service +{ + public class RoleService + { + private readonly DevHiveContext _context; + + public RoleService(DevHiveContext context) + { + this._context = context; + } + + public Task CreatePost(string name) + { + throw new NotImplementedException(); + } + + public Task GetPostById(uint postId) + { + throw new NotImplementedException(); + } + } +} diff --git a/API/Service/UserService.cs b/API/Service/UserService.cs index d480bec..a1a9fde 100644 --- a/API/Service/UserService.cs +++ b/API/Service/UserService.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using API.Database; using AutoMapper; using Data.Models.Classes; -using Data.Models.DTOs; +using Data.Models.DTOs.Identity; using Microsoft.AspNetCore.Mvc; using Data.Models.Options; using System.IdentityModel.Tokens.Jwt; @@ -47,7 +47,7 @@ namespace API.Service new Claim(ClaimTypes.Role, user.Role) // Authorize user by role }), Expires = DateTime.UtcNow.AddDays(7), - SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.Sha512) + SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha512Signature) }; var tokenHandler = new JwtSecurityTokenHandler(); -- cgit v1.2.3