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