# OAuthOptions

`interface` in `plugin-oauth` · v0.1.0

<https://seedcord.org/docs/packages/plugin-oauth/0.1.0/interfaces/oauth-options>

What [`with`](/docs/packages/plugin-oauth/0.1.0/classes/oauth#with) takes.

```ts
interface OAuthOptions<
    TScopes extends OAuthScope = never,
    TExtra extends OAuthScope = never
> extends Pick<
    OAuthClientOptions<TScopes, TExtra>,
    "scopes" | "extraScopes"
>
```

## Properties

### onFailure

```ts
onFailure?: ((failure: Simplify<FailedLogin>, request: Request) => Promisable<Response>) | undefined
```

Runs when a login didn't finish, for every `kind` of [`FailedLogin`](/docs/packages/plugin-oauth/0.1.0/types/failed-login). Without it, the visitor
gets a plain page that says so. The plugin logs a `failed` login's error before it calls this.

### onLogin

```ts
onLogin?: ((login: Simplify<CompletedLogin>, request: Request) => Promisable<Response>) | undefined
```

Runs after the plugin saves the user's tokens. Return the visitor's response, usually a redirect
that sets your session. Without it, the visitor gets a plain page that says the login worked.
