mirror of
https://github.com/Dan6erbond/sk-auth.git
synced 2024-11-20 19:07:20 +01:00
🏷️ Make OAuth2ProviderConfig.scope
and params
optional for better type inference in client applications
This commit is contained in:
parent
1b3c804590
commit
d64d9f1807
@ -10,10 +10,10 @@ export interface OAuth2ProviderConfig<ProfileType = any, TokensType extends OAut
|
|||||||
profileUrl?: string;
|
profileUrl?: string;
|
||||||
clientId?: string;
|
clientId?: string;
|
||||||
clientSecret?: string;
|
clientSecret?: string;
|
||||||
scope: string | string[];
|
scope?: string | string[];
|
||||||
headers?: any;
|
headers?: any;
|
||||||
authorizationParams?: any;
|
authorizationParams?: any;
|
||||||
params: any;
|
params?: any;
|
||||||
grantType?: string;
|
grantType?: string;
|
||||||
responseType?: string;
|
responseType?: string;
|
||||||
contentType?: "application/json" | "application/x-www-form-urlencoded";
|
contentType?: "application/json" | "application/x-www-form-urlencoded";
|
||||||
@ -43,7 +43,7 @@ export class OAuth2Provider<
|
|||||||
nonce,
|
nonce,
|
||||||
response_type: this.config.responseType,
|
response_type: this.config.responseType,
|
||||||
client_id: this.config.clientId,
|
client_id: this.config.clientId,
|
||||||
scope: Array.isArray(this.config.scope) ? this.config.scope.join(" ") : this.config.scope,
|
scope: Array.isArray(this.config.scope) ? this.config.scope.join(" ") : this.config.scope!,
|
||||||
redirect_uri: this.getCallbackUri(auth, host),
|
redirect_uri: this.getCallbackUri(auth, host),
|
||||||
...(this.config.authorizationParams ?? {}),
|
...(this.config.authorizationParams ?? {}),
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user