aboutsummaryrefslogtreecommitdiff
path: root/Backend/Api/Api/Controllers/AuthController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Backend/Api/Api/Controllers/AuthController.cs')
-rw-r--r--Backend/Api/Api/Controllers/AuthController.cs11
1 files changed, 11 insertions, 0 deletions
diff --git a/Backend/Api/Api/Controllers/AuthController.cs b/Backend/Api/Api/Controllers/AuthController.cs
index cbd5eb8..abb7adc 100644
--- a/Backend/Api/Api/Controllers/AuthController.cs
+++ b/Backend/Api/Api/Controllers/AuthController.cs
@@ -37,6 +37,17 @@ namespace Api.Controllers
return Ok();
}
+ [HttpPost("refreshJwt")]
+ [Authorize(Roles ="User")]
+ public async Task<ActionResult<string>> refreshJwt()
+ {
+ var jwt = await _userService.RenewToken();
+ if (jwt != null)
+ {
+ return Ok(jwt);
+ }
+ return BadRequest("Pogresno uneti podaci");
+ }
[HttpPost("login")]
public async Task<ActionResult<string>> Login([FromBody] Login creds)
{