aboutsummaryrefslogtreecommitdiffstats
path: root/code/api/Endpoints/Base.cs
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-12-22 14:44:26 +0100
committerivarlovlie <git@ivarlovlie.no>2022-12-22 14:44:26 +0100
commit58ef5833b3f77f321c587dd86448c888029016ce (patch)
treefe5e6f47781573cc1fb5938f9b8cd8b51022946a /code/api/Endpoints/Base.cs
parent82ade3c31fb17b662feec59e9e654ceb66edbb7a (diff)
downloadstorage-58ef5833b3f77f321c587dd86448c888029016ce.tar.xz
storage-58ef5833b3f77f321c587dd86448c888029016ce.zip
feat: Many things
- Working Login/Logout - Groundwork for web components - Loading web-components with version tag - Load temporal-polyfill globally
Diffstat (limited to 'code/api/Endpoints/Base.cs')
-rw-r--r--code/api/Endpoints/Base.cs36
1 files changed, 0 insertions, 36 deletions
diff --git a/code/api/Endpoints/Base.cs b/code/api/Endpoints/Base.cs
deleted file mode 100644
index 211d1f6..0000000
--- a/code/api/Endpoints/Base.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Security.Claims;
-
-namespace I2R.Storage.Api.Endpoints;
-
-[ApiController]
-[Authorize]
-public class Base : ControllerBase
-{
- public class LoggedInUserModel
- {
- public string Username { get; set; }
- public Guid Id { get; set; }
- public EUserRole Role { get; set; }
-
- public class Public
- {
- public string Id { get; set; }
- public string Username { get; set; }
- public string Role { get; set; }
- }
-
- public Public ForThePeople(HttpContext httpContext) {
- return new Public() {
- Id = httpContext.User.FindFirstValue(AppClaims.USER_ID),
- Username = httpContext.User.FindFirstValue(AppClaims.USERNAME),
- Role = httpContext.User.FindFirstValue(AppClaims.USER_ROLE)
- };
- }
- }
-
- public LoggedInUserModel LoggedInUser => new LoggedInUserModel() {
- Id = HttpContext.User.FindFirstValue(AppClaims.USER_ID).AsGuid(),
- Username = HttpContext.User.FindFirstValue(AppClaims.USERNAME),
- Role = UserRole.FromString(HttpContext.User.FindFirstValue(AppClaims.USER_ROLE))
- };
-} \ No newline at end of file