Update AuthController routes; add Test endpoint
Refactored route attributes for Login and Status actions to use nameof() for improved maintainability. Added a new Test GET endpoint that returns a simple OK response.
This commit is contained in:
@@ -29,7 +29,7 @@ public class AuthController : ControllerBase
|
|||||||
/// Triggers the NTLM handshake and returns authenticated user info.
|
/// Triggers the NTLM handshake and returns authenticated user info.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[HttpGet("login")]
|
[HttpGet(nameof(Login))]
|
||||||
public IActionResult Login()
|
public IActionResult Login()
|
||||||
{
|
{
|
||||||
var identity = User.Identity;
|
var identity = User.Identity;
|
||||||
@@ -93,7 +93,7 @@ public class AuthController : ControllerBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[HttpGet("status")]
|
[HttpGet(nameof(Status))]
|
||||||
public IActionResult Status()
|
public IActionResult Status()
|
||||||
{
|
{
|
||||||
return Ok(new
|
return Ok(new
|
||||||
@@ -102,4 +102,7 @@ public class AuthController : ControllerBase
|
|||||||
User.Identity?.AuthenticationType
|
User.Identity?.AuthenticationType
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet(nameof(Test))]
|
||||||
|
public IActionResult Test() => Ok();
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user