summaryrefslogtreecommitdiffstats
path: root/src/server/Api/Internal/Account
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/Api/Internal/Account')
-rw-r--r--src/server/Api/Internal/Account/GetProfileDataRoute.cs35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/server/Api/Internal/Account/GetProfileDataRoute.cs b/src/server/Api/Internal/Account/GetProfileDataRoute.cs
index c68f295..adf1cba 100644
--- a/src/server/Api/Internal/Account/GetProfileDataRoute.cs
+++ b/src/server/Api/Internal/Account/GetProfileDataRoute.cs
@@ -2,45 +2,10 @@ namespace IOL.BookmarkThing.Server.Api.Internal.Account;
public class GetProfileDataRoute : RouteBaseInternalSync.WithoutRequest.WithActionResult<LoggedInInternalUser>
{
- private readonly AppDbContext _context;
- private readonly ILogger<GetProfileDataRoute> _logger;
-
- public GetProfileDataRoute(ILogger<GetProfileDataRoute> logger, AppDbContext context) {
- _logger = logger;
- _context = context;
- }
-
[ApiVersionNeutral]
[ApiExplorerSettings(IgnoreApi = true)]
[HttpGet("~/v{version:apiVersion}/account/profile-data")]
public override ActionResult<LoggedInInternalUser> Handle() {
- // if (!Guid.TryParse(User.FindFirstValue(ClaimTypes.NameIdentifier), out var _)) {
- // var github_id = User.FindFirstValue(AppClaims.GITHUB_ID);
- // if (github_id.HasValue()) {
- // var existing_mapping = _context.GithubUserMappings.Include(c => c.User).SingleOrDefault(c => c.GithubId == github_id);
- // var id = new ClaimsIdentity();
- // if (existing_mapping != default) {
- // id.AddClaims(existing_mapping.User.DefaultClaims());
- // User.AddIdentity(id);
- // } else {
- // var name = User.FindFirstValue(ClaimTypes.Name);
- // var user = new User(name) {
- // Id = Guid.NewGuid()
- // };
- // var mapping = new GithubUserMapping {
- // GithubId = github_id,
- // User = user
- // };
- // _context.GithubUserMappings.Add(mapping);
- // _context.SaveChanges();
- // id.AddClaims(mapping.User.DefaultClaims());
- // User.AddIdentity(id);
- // }
- //
- // _logger.LogInformation("Added user mapping for github user");
- // }
- // }
-
return Ok(LoggedInUser);
}
}