summaryrefslogtreecommitdiffstats
path: root/src/server/Api/Internal/BaseInternalRoute.cs
blob: 6c0a2d9aea02f4ca0dd087a57f9f9a4381a51d56 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
namespace IOL.BookmarkThing.Server.Api.Internal;

/// <inheritdoc />
[Authorize]
[ApiController]
public class BaseInternalRoute : ControllerBase
{

	/// <summary>
	/// User data for the currently logged on user.
	/// </summary>
	protected LoggedInInternalUser LoggedInUser => new() {
			Id = User.FindFirstValue(ClaimTypes.NameIdentifier).ToGuid(),
			Username = User.Identity?.Name,
	};
}