Share page skeleton

This commit is contained in:
eikek
2021-10-03 01:32:56 +02:00
parent aa21e7a74c
commit 97922340d9
10 changed files with 231 additions and 7 deletions

View File

@ -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