Skip to main content

Interface: ServerOptionsAuth

@sapphire/plugin-api.ServerOptionsAuth

Defines the authentication options.

Since

1.0.0

Properties

Optional cookie: string

The name for the cookie, this will be used to identify a Secure HttpOnly cookie.

Since

1.0.0

Default

'SAPPHIRE_AUTH'

Defined in

projects/plugins/packages/api/src/lib/structures/http/Auth.ts:190


domainOverwrite

Optional domainOverwrite: string

The domain that should be used for the cookie. This overwrites the automatic detection of the domain.

Remark

if you want to support subdomains (one.example.two and two.example.com) then you need to use prefix your domain with a ., for example .example.com

Since

2.1.0

Default

undefined

Defined in

projects/plugins/packages/api/src/lib/structures/http/Auth.ts:223


id

id: string

The client's application id, this can be retrieved in Discord Developer Portal at https://discord.com/developers/applications.

Since

1.0.0

Defined in

projects/plugins/packages/api/src/lib/structures/http/Auth.ts:183


redirect

Optional redirect: string

The redirect uri. This will default to OAuth2BodyData.redirectUri if missing.

Since

1.0.0

Defined in

projects/plugins/packages/api/src/lib/structures/http/Auth.ts:209


scopes

Optional scopes: OAuth2Scopes[]

The scopes defined at https://discord.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes.

Since

1.0.0

Default

[OAuth2Scopes.Identify]

Defined in

projects/plugins/packages/api/src/lib/structures/http/Auth.ts:203


secret

secret: string

The client secret, this can be retrieved in Discord Developer Portal at https://discord.com/developers/applications.

Since

1.0.0

Defined in

projects/plugins/packages/api/src/lib/structures/http/Auth.ts:196


transformers

Optional transformers: LoginDataTransformer<LoginData>[]

The login data transformers used for Auth.fetchData.

Since

1.4.0

Default

[]

Defined in

projects/plugins/packages/api/src/lib/structures/http/Auth.ts:216