diff --git a/CoviDok/Controllers/AuthController.cs b/CoviDok/Controllers/AuthController.cs index 38b4e61..b5696c6 100644 --- a/CoviDok/Controllers/AuthController.cs +++ b/CoviDok/Controllers/AuthController.cs @@ -20,12 +20,22 @@ namespace CoviDok.Controllers public async Task> PostLogin(AuthLogin authLogin) { AuthIdentity authIdentity = new AuthIdentity(); - if (authLogin.Email == "a" && authLogin.Password == "a") + authIdentity.FirstName = "Sajt"; + authIdentity.LastName = "Osperec"; + authIdentity.Id = "asdfasdfadf"; //SessionID + if (authLogin.Email == "a@domain.tld" && authLogin.Password == "a") + { + authIdentity.Role = Role.Doc; + return authIdentity; + } + if (authLogin.Email == "b@domain.tld" && authLogin.Password == "b") + { + authIdentity.Role = Role.Ast; + return authIdentity; + } + if (authLogin.Email == "c@domain.tld" && authLogin.Password == "c") { - authIdentity.FirstName = "Sajt"; - authIdentity.LastName = "Osperec"; - authIdentity.Id = "asdfasdfadf"; - authIdentity.Role = Api.Role.Doc; + authIdentity.Role = Role.Par; return authIdentity; } return Unauthorized(); @@ -36,6 +46,7 @@ namespace CoviDok.Controllers public async Task> PostRegister(AuthRegistration authRegistration) { // System.Diagnostics.Debug.WriteLine(authRegistration.ToString()); + // Validate Email GenericResponse genericResponse = new GenericResponse(); if (authRegistration.Email == "a") {