Add src/Internal/Credentials.elm
parent
f7441a54eb
commit
faac764c07
|
@ -0,0 +1,32 @@
|
||||||
|
module Internal.Credentials exposing (..)
|
||||||
|
{-| The Credentials type is the keychain that stores all tokens, values,
|
||||||
|
numbers and other types that need to be remembered.
|
||||||
|
|
||||||
|
This file combines the internal functions with the API endpoints to create a fully functional Credentials keychain.
|
||||||
|
-}
|
||||||
|
|
||||||
|
import Internal.Values.Credentials as Internal
|
||||||
|
|
||||||
|
{-|
|
||||||
|
You can consider the `Credentials` type as a large ring of keys,
|
||||||
|
and Elm will figure out which key to use.
|
||||||
|
If you pass the `Credentials` into any function, then the library will look for
|
||||||
|
the right keys and tokens to get the right information.
|
||||||
|
-}
|
||||||
|
type alias Credentials = Internal.Credentials
|
||||||
|
|
||||||
|
{-| Get a Credentials type based on an unknown access token.
|
||||||
|
|
||||||
|
This is an easier way to connect to a Matrix homeserver, but your access may end
|
||||||
|
when the access token expires, is revoked or something else happens.
|
||||||
|
-}
|
||||||
|
fromAccessToken : { homeserver : String, accessToken : String } -> Credentials
|
||||||
|
fromAccessToken =
|
||||||
|
Internal.fromAccessToken
|
||||||
|
|
||||||
|
{-| Get a Credentials type using a username and password. -}
|
||||||
|
fromLoginCredentials : { username : String, password : String, homeserver : String } -> Credentials
|
||||||
|
fromLoginCredentials =
|
||||||
|
Internal.fromLoginCredentials
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue