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:186


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:219


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:179


redirect

โ€ข Optional redirect: string

The redirect uri. This will default to {@link OAuth2BodyData.redirectUri} if missing.

since 1.0.0

Defined in

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


scopes

โ€ข Optional scopes: string[]

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

since 1.0.0

default ['identify']

Defined in

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


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:192


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:212