[login-with-amazon] Add scope_data to AuthorizeOptions (#39287)

* Add generous overload for authorize

* Add scope_data field
This commit is contained in:
Jeff Held
2019-10-22 11:03:33 -07:00
committed by Wesley Wigham
parent bb88084eaa
commit bc6f467351
2 changed files with 14 additions and 0 deletions
+11
View File
@@ -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");