aboutsummaryrefslogtreecommitdiff
path: root/Backend/Api/Api/Controllers/AuthController.cs
diff options
context:
space:
mode:
authorTAMARA JERINIC <tamara.jerinic@gmail.com>2022-12-09 21:58:37 +0100
committerTAMARA JERINIC <tamara.jerinic@gmail.com>2022-12-09 21:58:37 +0100
commit2be5fb31bdf9400d7419159c1d37bf25306b0741 (patch)
treee38e1f03a708fbd366b3b0c3a6f3b312233e55a1 /Backend/Api/Api/Controllers/AuthController.cs
parentd776acefb2316f875b93dbe956253e160c003a58 (diff)
parent8da0efaf10d33e919aab0ae53e5117cc2dd02429 (diff)
Merge branch 'develop' of http://gitlab.pmf.kg.ac.rs/BrzoDoLokacije2022/odyssey/brzodolokacije into develop
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();
+ }
+
}
}