Esempio n. 1
0
        public ActionResult <LoginVoorRaadpleegDto> AuthenticateStandhouder([FromBody] AuthenticatieStandhouderDto authenticatie)
        {
            string token = _authenticatieRepository.AuthenticeerStandhouder(authenticatie.InschrijvingsId, authenticatie.Email);

            if (string.IsNullOrWhiteSpace(token))
            {
                return(NotFound($"Inschrijvingsnummer of E-mail is niet correct."));
            }

            LoginVoorRaadpleegDto loginToReturn = new LoginVoorRaadpleegDto
            {
                Token = token
            };

            return(Ok(loginToReturn));
        }
Esempio n. 2
0
        public ActionResult <LoginVoorRaadpleegDto> AuthenticateAdministrator([FromBody] AuthenticatieAdministratorDto authenticatie)
        {
            string token = _authenticatieRepository.AuthenticeerAdministrator(authenticatie.Email, authenticatie.Wachtwoord);

            if (string.IsNullOrWhiteSpace(token))
            {
                return(NotFound($"E-mail of wachtwoord is niet correct."));
            }

            LoginVoorRaadpleegDto loginToReturn = new LoginVoorRaadpleegDto
            {
                Token = token
            };

            return(Ok(loginToReturn));
        }