public Response<SessionInfo> LogIn(LoginDTO logInModel) { return PostDataToRoute<SessionInfo, LoginDTO>(Host + Resources.RouteLogIn, logInModel); }
private void SignUp() { Logger.Debug(Resources.InfoStartedSignUp); IoService.Out.Write("Login:"); string login = IoService.In.ReadLine(); IoService.Out.Write(Resources.InfoFirstName); string firstName = IoService.In.ReadLine(); IoService.Out.Write(Resources.InfoLastName); string lastName = IoService.In.ReadLine(); string email = ReadAndValidateEmail(); string password = ReadAndValidatePassword(); try { RegistrationDTO regModel = new RegistrationDTO() { Email = email, LastName = lastName, FirstName = firstName, Password = password, ConfirmPassword = password, UserName = login }; var result = authenticator.Register(regModel); IoService.Out.WriteLine(result); LoginDTO loginModel = new LoginDTO() { UserName = login, Password = password }; Response<SessionInfo> response = authenticator.LogIn(loginModel); if (response.IsSuccessful) { Session = response.ResultTask.Result; } Logger.Info(Resources.InfoEndedSignUp); } catch (Exception ex) { IoService.Out.WriteLine(ex.Message); } }