mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
[login-with-amazon] Add scope_data to AuthorizeOptions (#39287)
* Add generous overload for authorize * Add scope_data field
This commit is contained in:
+11
@@ -49,8 +49,15 @@ interface AuthorizeOptions {
|
||||
*
|
||||
*/
|
||||
state?: string;
|
||||
scope_data?: AuthorizeScopeData;
|
||||
}
|
||||
|
||||
type AuthorizeScopeData = {
|
||||
[scope in AuthorizationScopeOptions]?: {
|
||||
essential: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* Accepted values for `scope` member of `authorize` options.
|
||||
@@ -213,6 +220,10 @@ declare namespace amazon {
|
||||
options: CodeAuthorizeOptions,
|
||||
next?: string | NextCallback<CodeRequest>
|
||||
): CodeRequest;
|
||||
function authorize(
|
||||
options: AuthorizeOptions,
|
||||
next?: string | NextCallback<AuthorizeRequest>
|
||||
): AuthorizeRequest;
|
||||
|
||||
/**
|
||||
* Retrieves the customer profile and passes it to a callback function.
|
||||
|
||||
@@ -28,6 +28,9 @@ const request = amazon.Login.authorize({
|
||||
response_type: "code",
|
||||
state: "my-state",
|
||||
scope: "profile",
|
||||
scope_data: {
|
||||
postal_code: { essential: true },
|
||||
},
|
||||
});
|
||||
|
||||
request.onComplete("my://redirect.url");
|
||||
|
||||
Reference in New Issue
Block a user