alexbruf/elm-clerk/2.0.0

Clerk.EnterpriseAccount

The Clerk enterprise account resource, one entry of Clerk.User's enterpriseAccounts: an account the user holds through enterprise SSO.

type alias EnterpriseAccount =
{ id : Maybe String
, active : Bool
, emailAddress : String
, enterpriseConnectionId : Maybe String
, enterpriseConnection : Maybe EnterpriseConnection
, firstName : Maybe String
, lastName : Maybe String
, protocol : String
, provider : String
, providerUserId : Maybe String
, publicMetadata : Value
, verification : Maybe Verification
, lastAuthenticatedAt : Maybe Posix
}

One enterprise SSO account.

publicMetadata is passed through untouched as a JSON value, which is always an object.

decoder : Decoder EnterpriseAccount

Decode an EnterpriseAccount from the JSON the shim sends.

{ "id": "eac_2"
, "active": true
, "emailAddress": "[email protected]"
, "enterpriseConnectionId": "conn_1"
, "enterpriseConnection": EnterpriseConnection
, "firstName": "Ada"
, "lastName": "Lovelace"
, "protocol": "saml"
, "provider": "saml_okta"
, "providerUserId": "okta_1"
, "publicMetadata": {}
, "verification": Verification
, "lastAuthenticatedAt": 1700000000000
}

lastAuthenticatedAt arrives as epoch milliseconds and accepts null.