Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
npm1 committed Sep 11, 2023
1 parent 5053fb8 commit f692710
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,16 @@ This specification introduces a new type of {{DOMException}}, the {{IdentityCred
is used when the [=user agent=] does not receive an identity assertion after the user has requested
to use a federated account.

<xmp class="idl">
dictionary IdentityCredentialErrorInit {
DOMString code;
DOMString url;
};
</xmp>

<pre class="idl">
[Exposed=Window, SecureContext]
interface IdentityCredentialError: DOMException {
interface IdentityCredentialError : DOMException {
constructor(optional DOMString message = "", optional IdentityCredentialErrorInit options = {});
readonly attribute DOMString code;
readonly attribute DOMString url;
Expand Down Expand Up @@ -959,7 +966,7 @@ To <dfn>fetch an identity assertion</dfn> given a {{USVString}}
1. If |tokenUrl| is failure:
1. [=Queue a global task=] on the [=DOM manipulation task source=] given |globalObject| to
let |error| be a new {{IdentityCredentialError}} given |globalObject|'s
<a for="global object">realm</a>.
[=global object/realm=].
1. Wait for |error| to be set, and return it.
1. Let |requestBody| be the result of running [=urlencoded serializer=] with a list containing:
1. ("client_id", |provider|'s {{IdentityProviderConfig/clientId}})
Expand Down Expand Up @@ -1005,21 +1012,23 @@ To <dfn>fetch an identity assertion</dfn> given a {{USVString}}
|responseBody|.
1. If |json|[|token|] and |json|[|error|] both [=map/exist=] or both do not [=map/exist=],
set |credential| to a new {{IdentityCredentialError}} given |globalObject|'s
<a for="global object">realm</a> and "IdentityCredentialError", and return.
[=global object/realm=] and "IdentityCredentialError", and return.
1. If |json|[|token|] [=map/exists=]:
1. [=converted to an IDL value|Convert=] |json| to an {{IdentityProviderToken}}, |token|.
1. If one of the previous steps threw an exception, set |credential| to a new
{{IdentityCredentialError}} given |globalObject|'s <a for="global object">realm</a>
{{IdentityCredentialError}} given |globalObject|'s [=global object/realm=]
and "IdentityCredentialError", and return.
1. Let |credential| be a new {{IdentityCredential}} given |globalObject|'s
<a for="global object">realm</a>.
[=global object/realm=].
1. Set |credential|'s {{IdentityCredential/token}} to |token|.
1. Otherwise, i.e. if |json|[|error|] [=map/exists=]:
1. If |json|[|error|] is not an [=ordered map=], set |credential| to failure and return.
1. If |json|[|error|] is not an [=ordered map=], set |credential| to a new
{{IdentityCredentialError}} given |globalObject|'s [=global object/realm=] and
"IdentityCredentialError" and return.
1. [=converted to an IDL value|Convert=] |json| to an {{IdentityCredentialErrorInit}},
|errorInit|.
1. Let |credential| be a new {{IdentityCredentialError}} given |globalObject|'s
<a for="global object">realm</a>, "IdentityCredentialError", and |errorInit|.
[=global object/realm=], "IdentityCredentialError", and |errorInit|.
1. Wait for |credential| to be set.
1. Return |credential|.
</div>
Expand All @@ -1030,13 +1039,6 @@ dictionary IdentityProviderToken {
};
</xmp>

<xmp class="idl">
dictionary IdentityCredentialErrorInit {
DOMString code;
DOMString url;
};
</xmp>

<!-- ============================================================ -->
### Request permission to sign-up ### {#request-permission-signup}
<!-- ============================================================ -->
Expand Down

0 comments on commit f692710

Please sign in to comment.