Logging out

Let’s just decide that if the user clicks on the Home link on the menu, the user is logged out.

Let’s edit the index() method then.

  void index(string _error = null)
  {
    m_user = User.init;
    terminateSession;
    string error = _error;
    render!("index.dt", error);
  }

Here, we re-initialized the m_user session variable then explicitly terminated the session before displaying the index.dt template page.

Compile, run, refresh the browser and test the app. You will see that when you click on the Home link, you have to log in again to see the other pages.

This effectively completes the employee system part.

Last updated