public async Task <IActionResult> Login([FromBody] LoginCredentials loginCredentials) { try { await donorService.LoginAsync(loginCredentials.Pesel, loginCredentials.Password); } catch (UserNotFoundException e) { return(BadRequest(e.Message)); } var token = jwtService.CreateToken(loginCredentials.Pesel, "donor"); return(Ok(token)); }