# Authentication overview

## Authentication at a glance

Authentication is the account process that lets you enter Conduit, create an account, or
maintain the account you already use. Conduit uses authentication for sign-in and sign-up,
and provides account settings and logout after you enter the application.

Use this page to choose the account action that matches your need:

| If you need to… | Go to |
|---|---|
| Enter an existing account | [Sign in](doc:sign-in) |
| Create an account | [Sign up](doc:sign-up) |
| Review or change account details after entering the application | [Manage your settings](doc:manage-your-settings) |
| Continue into the application | [Articles overview](doc:articles-overview) |

## Before you start

Before you choose an account action, know whether you are signed out or already signed in.
The navigation presents **Sign in** and **Sign up** when no current user is present, and it
presents **Settings** when a current user is present.

Collect the information for the action you are about to take:

| Action | Information on the screen | What to have ready |
|---|---|---|
| Sign in | **Email** and **Password** | The email address and password for the existing account |
| Sign up | **Username**, **Email**, and **Password** | The username, email address, and password for the new account |
| Settings | **URL of profile picture**, **Username**, **Short bio about you**, **Email**, and **New Password** | The account details you want to review or change |

The settings form loads the current user's profile picture, username, biography, and email
when a current user is available. **New Password** starts as an empty settings value and is
removed from the update when it is left empty.

## Find the account action

The account action is the route that matches what you want to do: `/login` for an existing
account, `/register` for a new account, and `/settings` for an account already in the
application.

1. Open the navigation for your current account state.
2. Choose one option from the table.

   | If you need to… | Select |
   |---|---|
   | Enter an existing account | **Sign in** |
   | Create an account | **Sign up** |
   | Change account details while signed in | **Settings** |

3. Use the link for the account route you want.

   | If you are on… | Select | You open… |
   |---|---|---|
   | The sign-in screen | **Need an account?** | `/register` |
   | The sign-up screen | **Have an account?** | `/login` |

**Result:** You are on the route for the account action you selected.

## Understand the account screens

The sign-in screen collects the credentials for an existing account. The sign-up screen
collects the details for a new account. The settings screen collects profile and account
details for an existing current user.

| Screen | Fields |
|---|---|
| Sign in | **Email** — email input; **Password** — password input |
| Sign up | **Username** — text input; **Email** — email input; **Password** — password input |
| Settings | **URL of profile picture** — text input; **Username** — text input; **Short bio about you** — text area; **Email** — email input; **New Password** — password input |

The account screens show no required-field marker and do not apply a client-side validation rule.
Login uses **Email** and **Password**; sign-up adds **Username**; settings uses the profile
and account fields listed above.

## Sign in or sign up

Sign-in enters an existing account, while sign-up creates a new account using the fields on
the selected screen.

**Prerequisites**

- You are on `/login` or `/register`.
- You have the information listed for that route in [Before you start](#before-you-start).

**Steps**

1. Open the route for the action you need.
2. For `/login`, fill **Email** and **Password**. For `/register`, fill **Username**, **Email**,
   and **Password**.
3. Select the control for the route you opened: select **Sign in** on `/login`, or select
   **Sign up** on `/register`.

   | Route | Select |
   |---|---|
   | `/login` | **Sign in** |
   | `/register` | **Sign up** |

4. For detailed sign-in or sign-up instructions, open [Sign in](doc:sign-in) or [Sign up](doc:sign-up).

**Result:** The account-entry request has been submitted.

## Manage account settings

Account settings are the profile and account details you maintain after signing in. Use them
to review the current values, update the account, or leave the account.

**Prerequisites**

- You are signed in and can open `/settings`.
- You know which profile or account values you want to change.

**Steps**

1. Open `/settings`.
2. Review **URL of profile picture**.
3. Review **Username**.
4. Review **Short bio about you**.
5. Review **Email**.
6. Enter a value in **New Password** only when you want to change the password.
7. Select **Update Settings** to submit the settings form.
8. Select **Or click here to logout.** when you want to leave the account.
9. For the complete settings procedure, open [Manage your settings](doc:manage-your-settings).

**Result:** The settings form has been submitted, or the logout action has been selected.

## When account actions branch or go wrong

While sign-in, sign-up, or settings work is in progress, **Sign in**, **Sign up**, and
**Update Settings** become disabled. The account screens display API errors through the error
list when an API error is returned.

| What you see | What it means | What to do |
|---|---|---|
| **Sign in**, **Sign up**, or **Update Settings** is disabled | The related action is in progress. | Wait for the request to finish before selecting the control again. |
| An error list appears | The API returned error keys and values. | Read each entry and correct the related account information before submitting again. |
| An error entry appears | Each API error entry shows its error name followed by its message. | Use the error name and message shown to identify the information to correct. |

## Know what comes next

After account entry, the application flow continues with authenticated user work. Open
[Articles overview](doc:articles-overview) to continue into the article area. To complete a
specific account action, use [Sign in](doc:sign-in), [Sign up](doc:sign-up), or [Manage your
settings](doc:manage-your-settings).
