@Override
	public String process(List<String> params) throws Router.RedirectSystemError, IOException, Router.RedirectPageNotFound, Router.Redirect, SQLException, MessageException.ErrorMessage {
		AuthView view;
		switch (getActionByParam(params)) {
			case "register":
				view = new RegisterView();
				if (null != Registry.getInst().getRequestParam("register")) {
					try {
						String email = Registry.getInst().getRequestParam("email");
						String password = Registry.getInst().getRequestParam("pass");
						int humanId = register(email, password);
					} catch (AuthDAO.LoginIncorrect | AuthDAO.LoginExists e) {
						MessageException loginIncorrect = new MessageException.ErrorMessage(e.getMessage()).setName("loginIncorrect");
						view.addMessage(loginIncorrect);
					}
				}
				HashMap<String, String> formParams = new HashMap<String, String>();
				formParams.put("email", Registry.getInst().getRequestParam("email"));
				formParams.put("pass", Registry.getInst().getRequestParam("pass"));
				view.setData(formParams);
				break;
			case "login":
				view = new LoginView();
				try {
					login();
				} catch (LoginFail e) {
					view.addMessage(e);
				}
				break;
			case "":
				view = new MainView();
				break;
			default:
				throw new Router.RedirectPageNotFound();
		}

		return view.parse();
	}