From 9f58e2b31a49822a3d0cbd9a51da43dbb3fd6ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Andr=C3=A9?= Date: Sat, 17 Apr 2021 22:18:18 +0200 Subject: [PATCH] Fix --- Back/skydiveLogs-api/Controllers/Base.cs | 36 ++++++++++-------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/Back/skydiveLogs-api/Controllers/Base.cs b/Back/skydiveLogs-api/Controllers/Base.cs index 2799bd5..0909ae9 100644 --- a/Back/skydiveLogs-api/Controllers/Base.cs +++ b/Back/skydiveLogs-api/Controllers/Base.cs @@ -1,13 +1,7 @@ -using System; -using System.Linq; -using System.Security.Claims; -using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using skydiveLogs_api.Domain; - - namespace skydiveLogs_api.Controllers { [Route("api/[controller]")] @@ -15,21 +9,21 @@ namespace skydiveLogs_api.Controllers [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] public class Base : ControllerBase { - public User ConnectedUser - { - get - { - if (_connectedUser == null) - { - _connectedUser = new User(); - _connectedUser.Login = User.Claims.Single(c => c.Type == ClaimTypes.Name).Value; - _connectedUser.Id = Convert.ToInt32(User.Claims.Single(c => c.Type == ClaimTypes.UserData).Value); - } + //public User ConnectedUser + //{ + // get + // { + // if (_connectedUser == null) + // { + // _connectedUser = new User(); + // _connectedUser.Login = User.Claims.Single(c => c.Type == ClaimTypes.Name).Value; + // _connectedUser.Id = Convert.ToInt32(User.Claims.Single(c => c.Type == ClaimTypes.UserData).Value); + // } - return _connectedUser; - } - } + // return _connectedUser; + // } + //} - private User _connectedUser; + //private User _connectedUser; } } \ No newline at end of file