mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-23 02:48:26 +00:00
Share page skeleton
This commit is contained in:
@ -9,7 +9,9 @@ module Data.Flags exposing
|
||||
( Config
|
||||
, Flags
|
||||
, accountString
|
||||
, getAccount
|
||||
, getToken
|
||||
, isAuthenticated
|
||||
, withAccount
|
||||
, withoutAccount
|
||||
)
|
||||
@ -43,6 +45,24 @@ type alias Flags =
|
||||
}
|
||||
|
||||
|
||||
isAuthenticated : Flags -> Bool
|
||||
isAuthenticated flags =
|
||||
getAccount flags /= Nothing
|
||||
|
||||
|
||||
getAccount : Flags -> Maybe AuthResult
|
||||
getAccount flags =
|
||||
Maybe.andThen
|
||||
(\ar ->
|
||||
if ar.success then
|
||||
Just ar
|
||||
|
||||
else
|
||||
Nothing
|
||||
)
|
||||
flags.account
|
||||
|
||||
|
||||
getToken : Flags -> Maybe String
|
||||
getToken flags =
|
||||
flags.account
|
||||
|
Reference in New Issue
Block a user