CDPotion.Domain.FedCm (cdpotion v0.1.4)

Summary

Types

Corresponds to IdentityRequestAccount

Whether the dialog shown is an account chooser or an auto re-authentication dialog.

Whether this is a sign-up or sign-in action for this account, i.e. whether this account has ever been used to sign in to this RP before.

Functions

Parameters:

  • (Required) dialog_id: description not provided :(
  • (Optional) trigger_cooldown: description not provided :(

Parameters:

Resets the cooldown time, if any, to allow the next FedCM call to show a dialog even if one was recently dismissed by the user.

Parameters:

  • (Required) dialog_id: description not provided :(
  • (Required) account_index: description not provided :(

Types

@type account() :: %{
  accountId: String.t(),
  email: String.t(),
  givenName: String.t(),
  idpConfigUrl: String.t(),
  idpSigninUrl: String.t(),
  loginState: login_state(),
  name: String.t(),
  pictureUrl: String.t(),
  privacyPolicyUrl: String.t() | nil,
  termsOfServiceUrl: String.t() | nil
}

Corresponds to IdentityRequestAccount

Link to this type

dialog_type()

@type dialog_type() :: :AccountChooser | :AutoReauthn

Whether the dialog shown is an account chooser or an auto re-authentication dialog.

Link to this type

login_state()

@type login_state() :: :SignIn | :SignUp

Whether this is a sign-up or sign-in action for this account, i.e. whether this account has ever been used to sign in to this RP before.

Functions

@spec disable() :: {String.t(), map()}
Link to this function

dismiss_dialog(dialog_id, trigger_cooldown \\ nil)

@spec dismiss_dialog(String.t(), boolean()) :: {String.t(), map()}

Parameters:

  • (Required) dialog_id: description not provided :(
  • (Optional) trigger_cooldown: description not provided :(
Link to this function

enable(disable_rejection_delay \\ nil)

@spec enable(boolean()) :: {String.t(), map()}

Parameters:

Link to this function

reset_cooldown()

@spec reset_cooldown() :: {String.t(), map()}

Resets the cooldown time, if any, to allow the next FedCM call to show a dialog even if one was recently dismissed by the user.

Link to this function

select_account(dialog_id, account_index)

@spec select_account(String.t(), integer()) :: {String.t(), map()}

Parameters:

  • (Required) dialog_id: description not provided :(
  • (Required) account_index: description not provided :(