> For the complete documentation index, see [llms.txt](https://trillo.gitbook.io/developing-ui-using-trillo-workbench/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trillo.gitbook.io/developing-ui-using-trillo-workbench/developing-ui-using-trillo-workbench/angular/app-functionalities/logout-icon.md).

# Logout Icon

* This icon will navigate us to the login page.

<figure><img src="/files/CaB5Y9CSKkYQBqBXnWtq" alt=""><figcaption><p>Logout Icon</p></figcaption></figure>

Upon selecting the logout option, the system redirects users to the login page and clears the local storage as a security measure.

<figure><img src="/files/6qqVmrMfka79yI8zUvwp" alt=""><figcaption><p>Login Page</p></figcaption></figure>

#### Logout Code Snippet

```
 logout(){
   localStorage.clear();
   this.router.navigateByUrl('/auth/login')
  }
```

#### Code Description

The logout function, when invoked by a user, is responsible for terminating the user's session. The two main actions performed by this function are:

**Clearing Local Storage**

* The line localStorage.clear(); ensures that any data stored in the web browser's localStorage, which could include information related to the user's session or authentication such as tokens or user preferences, is removed.

**Navigating to the Login Page**

* The subsequent line this.router.navigateByUrl('/auth/login'); utilizes a router service to direct the user to the '/auth/login' route. This navigation effectively redirects the user to the login page, facilitating a seamless transition after the logout process.
