> ## Documentation Index
> Fetch the complete documentation index at: https://docs.result.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

> Email/password auth with sessions the SDK manages for you.

```ts theme={"dark"}
await backend.auth.signUp({ email, password, name }); // signs the user in immediately
await backend.auth.signInWithPassword({ email, password });
const { data } = await backend.auth.getCurrentUser();
await backend.auth.signOut();
```

After sign-in the SDK attaches the user's session to every database, storage,
function, and realtime call automatically - RLS-scoped tables just work.

## Password reset

```ts theme={"dark"}
await backend.auth.sendResetPasswordEmail({ email, redirectTo });
await backend.auth.resetPassword({ newPassword, otp });
```

## Profiles

```ts theme={"dark"}
const { data } = await backend.auth.getProfile(userId);
await backend.auth.setProfile({ name, avatar_url });
```

## Debugging

List who has actually signed up:

```bash theme={"dark"}
npx @resultdev/cli auth users
```

Signup returns a session immediately - email verification is pre-configured
off, so there is no "check your email" stall to handle.
