alexbruf/elm-clerk/2.0.0

Clerk.ExternalAccount

The Clerk external account resource, one entry of Clerk.User's externalAccounts: an OAuth account the user has connected.

type alias ExternalAccount =
{ id : String
, identificationId : String
, provider : String
, providerUserId : String
, emailAddress : String
, approvedScopes : String
, firstName : String
, lastName : String
, imageUrl : String
, username : Maybe String
, phoneNumber : Maybe String
, label : Maybe String
, publicMetadata : Value
, verification : Maybe Verification
}

One connected OAuth account.

approvedScopes is the space separated scope string exactly as the provider returned it. publicMetadata is passed through untouched as a JSON value, which is always an object.

decoder : Decoder ExternalAccount

Decode an ExternalAccount from the JSON the shim sends.

{ "id": "eac_1"
, "identificationId": "idn_4"
, "provider": "google"
, "providerUserId": "1234567890"
, "emailAddress": "[email protected]"
, "approvedScopes": "email profile"
, "firstName": "Ada"
, "lastName": "Lovelace"
, "imageUrl": "https://img.clerk.com/ada"
, "username": null
, "phoneNumber": null
, "label": null
, "publicMetadata": {}
, "verification": Verification
}