Skip to content

Commit

Permalink
npm comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cbiesinger committed Sep 20, 2023
1 parent fb02431 commit d70fa1f
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions spec/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -664,21 +664,21 @@ the exception thrown.
* Return failure.
* Prompt the user whether to continue. This MAY include an affordance
to [=show an IDP sign-in dialog=]. If the user cancels or that
algorithm returns failure, return failure.
algorithm returns failure, return (failure, true).

Issue: We should perhaps provide a way to let the RP request that
the second option is provided, possibly gated on a user gesture.
See https://github.com/fedidcg/FedCM/issues/442 for discussion.
See [this issue](https://github.com/fedidcg/FedCM/issues/442) for discussion.
1. Let |requiresUserMediation| be |provider|'s {{IdentityProviderConfig/configURL}}'s [=/origin=]'s
[=requires user mediation=].
1. Let |mediation| be |options|'s {{CredentialRequestOptions/mediation}}.
1. If |requiresUserMediation| is true and |mediation| is
"{{CredentialMediationRequirement/silent}}", return failure.
1. Let |config| be the result of running [=fetch the config file=] with |provider| and
|globalObject| (this is the <dfn>fetch config step</dfn>).
"{{CredentialMediationRequirement/silent}}", return (failure, false).
1. <dfn>Fetch config step</dfn>: Let |config| be the result of running
[=fetch the config file=] with |provider| and |globalObject|.
1. If |config| is failure, return (failure, false).
1. Let |accountsList| be the result of [=fetch the accounts list=] with |config|, |provider|,
and |globalObject| (this is the <dfn>fetch accounts list step</dfn>).
1. <dfn>Fetch accounts list step</dfn>: Let |accountsList| be the result of
[=fetch the accounts list=] with |config|, |provider|, and |globalObject|.
1. If |accountsList| is failure, or the size of |accountsList| is 0:
1. [=map/set|Set=] an entry in the [=Sign-in Status map=] with the
key being the [=/origin=] of the {{IdentityProviderConfig/configURL}}
Expand All @@ -692,7 +692,7 @@ the exception thrown.
1. If |signinStatus| is [=signed-in=], show a dialog to the user. The
contents of this dialog are defined by the user agent. This dialog
SHOULD provide an affordance for the user to trigger the [=show an
IDP sign-in dialog=] algorithm; this dialog is then the <dfn>confirm
IDP sign-in dialog=] algorithm; this dialog is the <dfn>confirm
IDP sign-in dialog</dfn>.

Note: This situation happens when the browser expects the user
Expand All @@ -703,14 +703,14 @@ the exception thrown.
impossible by always showing UI of some kind when credentials
were sent to the server.

If the user closes the dialog, return failure.
If the user closes the dialog, return (failure, true).

If the [=show an IDP sign-in dialog=] algorithm was triggered:

1. Let |result| be the result of that algorithm.
1. If |result| is failure, return failure. The user agent MAY
show a dialog to the user before or after returning failure
indicating this failure.
1. If |result| is failure, return (failure, true). The user
agent MAY show a dialog to the user before or after
returning failure indicating this failure.
1. Otherwise, go back to the [=fetch config step=]. As an
optimization, the user agent MAY instead go to the
[=fetch accounts list step=].
Expand Down Expand Up @@ -744,7 +744,7 @@ the exception thrown.
[=compute the connection status=] algorithm given |provider| and |account|. When doing this,
the user agent MAY show some UI to the user indicating that they are being
<dfn>auto-reauthenticated</dfn>.
1. Otherwise, if |mediation| is "{{CredentialMediationRequirement/silent}}", return failure.
1. Otherwise, if |mediation| is "{{CredentialMediationRequirement/silent}}", return (failure, false).
1. Otherwise, if |accountsList|'s size is 1:
1. Set |account| to |accountsList|[0].
1. Set |accountState| to the result of running the [=compute the connection status=] algorithm
Expand Down Expand Up @@ -1281,20 +1281,19 @@ the following steps. This returns success or failure.
1. The user agent MAY [=set up browsing context features=] or otherwise
affect the presentation of this traversable in an implementation-defined
way.
1. Let |status_changed| be false.
1. Listen for changes to the [=sign-in status map=] where the key is the
the [=/origin=] of the {{IdentityProviderAPIConfig/signin_url}} and
the value is [=signed-in=]. If such a change happens, set
|status_changed| to true.

Note: The IDP sign-in flow may trigger this change using either
the [[#signin-status-javascript|JavaScript]] or
[[#signin-status-http|HTTP header]] API.
1. Wait for one of the following conditions:
* The user closes the browsing context: return failure.
* {{IdentityProvider}}.{{IdentityProvider/close}} is called:
1. Close the browsing context.
1. If |status_changed| is true, return success.
1. Let |signinStatus| be the value of the entry in [=Sign-in Status map=]
with the key being the origin of the {{IdentityProviderAPIConfig/signin_url}}.

Note: The IDP sign-in flow may set this value to signed-in using
either the [[#signin-status-javascript|JavaScript]] or
[[#signin-status-http|HTTP header]] API during the signin
flow. It is also possible that this change happened in
a different browsing context.
1. If |signinStatus| is [=signed-in=], return success.
1. Otherwise, return failure.
</div>

Expand Down

0 comments on commit d70fa1f

Please sign in to comment.