> 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://trillo.gitbook.io/developing-ui-using-trillo-workbench/developing-ui-using-trillo-workbench/angular/app-functionalities/logout-icon.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
