feat: add a cache with a short lifetime
This commit is contained in:
parent
31087a57c9
commit
fba842acc3
@ -6,6 +6,7 @@ using Microsoft.Extensions.Options;
|
|||||||
using Mirea.Api.Dto.Common;
|
using Mirea.Api.Dto.Common;
|
||||||
using Mirea.Api.Dto.Requests;
|
using Mirea.Api.Dto.Requests;
|
||||||
using Mirea.Api.Dto.Responses;
|
using Mirea.Api.Dto.Responses;
|
||||||
|
using Mirea.Api.Endpoint.Common.Attributes;
|
||||||
using Mirea.Api.Endpoint.Common.Services;
|
using Mirea.Api.Endpoint.Common.Services;
|
||||||
using Mirea.Api.Endpoint.Common.Settings;
|
using Mirea.Api.Endpoint.Common.Settings;
|
||||||
using Mirea.Api.Security.Common.Dto.Requests;
|
using Mirea.Api.Security.Common.Dto.Requests;
|
||||||
@ -162,5 +163,6 @@ public class AuthController(IOptionsSnapshot<Admin> user, AuthService auth, Pass
|
|||||||
[HttpGet("GetRole")]
|
[HttpGet("GetRole")]
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
|
[CacheMaxAge(0, 0, 1)]
|
||||||
public ActionResult<AuthRoles> GetRole() => Ok(AuthRoles.Admin);
|
public ActionResult<AuthRoles> GetRole() => Ok(AuthRoles.Admin);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user