Path: redb/redb.Templates/templates/redb-identity-app/RedbIdentityApp.Module/Controllers/MeController.cs Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages. License: Apache-2.0. Repository: https://github.com/redbase-app/redb Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Templates/templates/redb-identity-app/RedbIdentityApp.Module/Controllers/MeController.cs ---- using redb.Route.Controllers.Attributes; using RedbIdentityApp.Contracts; using RedbIdentityApp.Module.Identity; namespace RedbIdentityApp.Module.Controllers; /// GET /api/me: who the module sees behind the token. Handy to check a token by hand. [Route("/api/me")] public sealed class MeController : ApiController { [HttpGet] public MeDto Get() { var caller = Caller; return new MeDto { Subject = Subject, UserId = long.TryParse(caller.FindFirst(BearerTokenValidator.UserIdClaim)?.Value, out var id) ? id : null, UserName = caller.FindFirst(BearerTokenValidator.NameClaim)?.Value, ClientId = caller.FindFirst(BearerTokenValidator.ClientIdClaim)?.Value, Scopes = caller.FindAll(BearerTokenValidator.ScopeClaim).Select(c => c.Value).ToList(), ExpiresAt = long.TryParse(caller.FindFirst(BearerTokenValidator.ExpiresClaim)?.Value, out var exp) ? DateTimeOffset.FromUnixTimeSeconds(exp) : null, }; } }