aboutsummaryrefslogtreecommitdiff
path: root/Backend/Api/Api/Controllers/AuthController.cs
diff options
context:
space:
mode:
authorbranislav.radivojevic <wafflemynxyt@gmail.com>2022-12-09 00:27:43 +0100
committerbranislav.radivojevic <wafflemynxyt@gmail.com>2022-12-09 00:27:43 +0100
commit1ab59a4b3dc257e5b8bd7dd08eb8eeb043f33dea (patch)
tree7f57f322e47793ee2e60e10c6d3ed2f2b1ded9fb /Backend/Api/Api/Controllers/AuthController.cs
parent3249bb44349919e587ec2c7e44b75c4e2e324d7f (diff)
konacne ispravke i feature za Single Post
Diffstat (limited to 'Backend/Api/Api/Controllers/AuthController.cs')
-rw-r--r--Backend/Api/Api/Controllers/AuthController.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/Backend/Api/Api/Controllers/AuthController.cs b/Backend/Api/Api/Controllers/AuthController.cs
index abb7adc..b63665b 100644
--- a/Backend/Api/Api/Controllers/AuthController.cs
+++ b/Backend/Api/Api/Controllers/AuthController.cs
@@ -120,5 +120,15 @@ namespace Api.Controllers
return base.Content(html, "text/html");
}
}
+ [HttpGet("jwttoid")]
+ [Authorize(Roles = "User")]
+ public async Task<ActionResult<string>> JwtToUserId()
+ {
+ var userid = await _userService.UserIdFromJwt();
+ if (userid != null)
+ return Ok(userid);
+ return BadRequest();
+ }
+
}
}