## Class login_controller

zeep::http::login_controller — http controller that handles login and logout

## Synopsis

    // In header: <zeep/http/login-controller.hpp>

    class login_controller : public  {
    public:
      // construct/copy/destruct
      ( = "/");

      // public member functions
       (basic_server *);
       (request &, reply &);
      xml::document (request &) ;
       (request &, reply &);
    };

## Description

There is a html version of this controller as well, that one is a bit nicer

### `login_controller` public construct/copy/destruct

1.     ( prefix_path = "/");

### `login_controller` public member functions

1.      (basic_server * server);

   bind this controller to server

   Makes sure the server has a security context and adds rules to this security context to allow access to the /login page

2.      (request & req, reply & rep);

   will handle the actual requests

3.     xml::document (request & req) ;

   return the XHTML login form, subclasses can override this to provide custom login forms

   The document returned should have input fields for 'username', 'password' and a hidden '_csrf' and 'uri' value.

   The _csrf value is used to guard against CSRF attacks. The uri is the location to redirect to in case of a valid login.

4.      (request & req, reply & reply);

   Create an error reply for an unauthorized access.

   An error handler may call this method to create a decent login screen.

   Parameters:

   `req` | The request that triggered this call