#102: Moving Models and constants to their own library (#104)

* #102: Moving Models and constants to their own library

* #102: Updated sln file

* #102: Updated README to include step install migration tool
This commit was merged in pull request #104.
This commit is contained in:
KD
2024-08-05 20:05:57 -04:00
committed by GitHub
parent 8900afdfd2
commit a89580ac70
52 changed files with 53 additions and 25 deletions
+37
View File
@@ -0,0 +1,37 @@
using Microsoft.AspNetCore.Mvc;
namespace Icarus.Controllers.V1;
public class BaseController : ControllerBase
{
#region Fiends
protected IConfiguration? _config;
#endregion
#region Methods
[ApiExplorerSettings(IgnoreApi = true)]
[Obsolete("Asymmetric key signing for tokens have been deprecated")]
protected string ParseBearerTokenFromHeader()
{
var token = string.Empty;
const string tokenType = "Bearer";
const string otherTokenType = "Jwt";
var req = Request;
var auth = req.Headers.Authorization;
var val = auth.ToString();
if ((val.Contains(tokenType) || val.Contains(otherTokenType)) && val.Split(" ").Count() > 1)
{
var split = val.Split(" ");
token = split[1];
}
return token;
}
#endregion
}