# Sign out of Conduit

Signing out ends your authenticated session. Use the protected **Settings** route when you
want to leave the signed-in part of Conduit.

| If you need to… | Go to |
|---|---|
| Open the page used for sign-out | [Open Settings](#open-settings) |
| Check why Settings is unavailable | [If you cannot open Settings](#if-you-cannot-open-settings) |
| Find **Or click here to logout.** below the form | [Find **Or click here to logout.** below the form](#find-or-click-here-to-logout-below-the-form) |
| End the session | [Sign out](#sign-out) |
| Maintain profile settings | [Update settings](doc:update-settings) |
| Change the password | [Change your password](doc:change-your-password) |
| Review authentication messages | [Authentication and loading messages](doc:authentication-and-loading-messages) |

## Before you start

You must be authenticated to open `/settings`. The route directs an unauthenticated request to
`/login`, and the sign-out control is available on the authenticated Settings surface.

## Open Settings

**Prerequisites**

You are signed in.

**Steps**

1. Open Settings using one of these paths:

   | If you are… | Do this |
   |---|---|
   | On a page with the authenticated navigation bar | Select **Settings**. |
   | Opening the route directly | Open `/settings`. |

**Result:** The `/settings` attempt either opens the authenticated Settings screen or directs an
unauthenticated request to `/login`.

## If you cannot open Settings

An unauthenticated session cannot use the protected Settings route.

**Prerequisites**

The `/settings` attempt did not open the authenticated Settings screen.

**Steps**

1. Choose the path that matches what you see:

   | What you see | Next action |
   |---|---|
   | The authenticated Settings page | Continue to [Find **Or click here to logout.** below the form](#find-or-click-here-to-logout-below-the-form). |
   | `/login` | Select [**Sign in**](doc:sign-in), then open `/settings` again after authentication. |

**Result:** You either have the Settings page ready for sign-out or a Login page ready for authentication.

## Find **Or click here to logout.** below the form

The Settings screen is the account-maintenance surface. Its heading is **Your Settings**. The
settings form has a separate **Update Settings** action, while the sign-out action sits below the
form.

| Screen area | Use |
|---|---|
| **Your Settings** | Compare the heading with the Settings page you intend to use. |
| Settings form | Leave the form unchanged when you only want to sign out. |
| **Update Settings** | Do not select this action when you only want to end the session. |
| **Or click here to logout.** | Select this action to end the authenticated session. |

The form uses input placeholder text rather than separate field captions. The screen has no
grid or column set, and sign-out has no fixed success, error, or confirmation message.

## Sign out

**Prerequisites**

The authenticated Settings screen is open.

**Steps**

1. Select **Or click here to logout.**.

**Result:** The session becomes unauthenticated, the token and current user are cleared, and the
app navigates to `/`.

## When sign-out does not complete

Sign-out is a direct action. It does not open a confirmation dialog or display a fixed
sign-out success or error message.

| What you see | What it means | What to do |
|---|---|---|
| No confirmation dialog appears | The sign-out action has no confirmation step. | Select **Or click here to logout.**. |
| No fixed success or error message appears | Sign-out has no fixed message. | Continue at `/` after selecting **Or click here to logout.**. |
| An error list appears on Settings | Each returned entry uses the format `<key> <message>`. | For settings changes, see [Update settings](doc:update-settings). |

## Know what happens next

After sign-out, authentication state is `unauthenticated`. The token is destroyed, the current
user is cleared, and navigation targets `/`.
