Example #1
0
        public IActionResult Login(CredentialsModel credentials)
        {
            VoterModel voter = Logic.GetVoterByCredentials(credentials);

            if (voter == null)
            {
                return(Unauthorized("Incorrect ID or ID production date"));
            }

            voter.JwtToken = JwtHelper.GetWjtToken(voter.VoterId, voter.IdProdDate.ToString());

            return(Ok(voter));
        }