diff options
Diffstat (limited to 'DSACore/Controllers/TokensController.cs')
-rw-r--r-- | DSACore/Controllers/TokensController.cs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/DSACore/Controllers/TokensController.cs b/DSACore/Controllers/TokensController.cs index a85cabe..f1ddb37 100644 --- a/DSACore/Controllers/TokensController.cs +++ b/DSACore/Controllers/TokensController.cs @@ -1,21 +1,18 @@ using DSACore.Hubs; using Microsoft.AspNetCore.Mvc; -namespace DSACore.Controllers -{ +namespace DSACore.Controllers { [Route("lobby/[controller]")] [ApiController] - public class TokensController : Controller - { + public class TokensController : Controller { // GET [HttpGet("{token}")] - public ActionResult<string> Get(string token) - { + public ActionResult<string> Get(string token) { if (!int.TryParse(token, out var intToken)) return BadRequest("The token has to be a 32 bit unsigned integer"); if (intToken == 42) return Ok("Scribble"); - + if (!Users.Tokens.Exists(x => x.GetHashCode() == intToken)) return NotFound(); var group = Users.Tokens.Find(x => x.GetHashCode() == intToken); |