OAuth2ProviderAuth

interface OAuth2ProviderAuth<_ProviderUserAuth extends ProviderUserAuth> {
	getAuthorizationUrl: () => Promise<readonly [url: URL, state: string | null]>;
	validateCallback: (code: string) => Promise<_ProviderUserAuth>;
}
Generics#
nameextendsdescription
_ProviderUserAuthProviderUserAuthvalidateCallback() return type

getAuthorizationUrl()#

Creates a new authorization url, optional with a state.

const getAuthorizationUrl: () => Promise<
	readonly [url: URL, state: string | null]
>;
Returns#
nametypedescription
urlURLauthorization url
statestring | nullstate, if defined

validateCallback()#

Validates the authorization code and returns a new ProviderUserAuth instance.

const validateCallback: (code: string) => Promise<_ProviderUserAuth>;
Parameters#
nametypedescription
codestringauthorization code
Returns#