29 lines
908 B
C#
29 lines
908 B
C#
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace skydiveLogs_api.Controllers
|
|
{
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
[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);
|
|
// }
|
|
|
|
// return _connectedUser;
|
|
// }
|
|
//}
|
|
|
|
//private User _connectedUser;
|
|
}
|
|
} |