Error generation for login page and redirection after registration