elm-format
parent
f18dbcc941
commit
70cbe5b682
|
@ -76,12 +76,14 @@ fromBaseUrl url =
|
|||
, vs = Nothing
|
||||
}
|
||||
|
||||
|
||||
{-| Get the user id registered by the `Credentials` type.
|
||||
-}
|
||||
getUserId : Credentials -> Maybe String
|
||||
getUserId (Credentials { access }) =
|
||||
Login.getUserId access
|
||||
|
||||
|
||||
{-| Retrieves the spec versions from a given `Credentials` value.
|
||||
-}
|
||||
versions : Credentials -> Maybe V.Versions
|
||||
|
|
|
@ -56,6 +56,7 @@ getToken t =
|
|||
UsernameAndPassword { token } ->
|
||||
token
|
||||
|
||||
|
||||
getUserId : AccessToken -> Maybe String
|
||||
getUserId t =
|
||||
case t of
|
||||
|
@ -71,6 +72,7 @@ getUserId t =
|
|||
UsernameAndPassword { userId } ->
|
||||
userId
|
||||
|
||||
|
||||
addToken : String -> AccessToken -> AccessToken
|
||||
addToken s t =
|
||||
case t of
|
||||
|
|
|
@ -334,10 +334,12 @@ updateWith vaultUpdate ((Vault ({ cred, context } as data)) as vault) =
|
|||
LoggedInWithUsernameAndPassword _ output ->
|
||||
Vault { data | context = Credentials.addToken output.accessToken context }
|
||||
|
||||
|
||||
getUsername : Vault -> Maybe String
|
||||
getUsername (Vault { context }) =
|
||||
Credentials.getUserId context
|
||||
|
||||
|
||||
{-| Set personal account data
|
||||
-}
|
||||
setAccountData : String -> E.Value -> Vault -> Task X.Error VaultUpdate
|
||||
|
|
|
@ -137,6 +137,7 @@ accountData =
|
|||
|
||||
The username is a `Maybe String` if the Vault hasn't had its first sync yet,
|
||||
and the API might not always be consistent on the username.
|
||||
|
||||
-}
|
||||
username : Vault -> Maybe String
|
||||
username =
|
||||
|
|
Loading…
Reference in New Issue