Update part8

This commit is contained in:
Richard Feldman
2018-05-05 07:17:06 -04:00
parent faa5b834c1
commit fecc3fe291
576 changed files with 14 additions and 44428 deletions

View File

@@ -1,18 +0,0 @@
module Data.Session exposing (Session, attempt)
import Data.AuthToken exposing (AuthToken)
import Data.User exposing (User)
type alias Session =
{ user : Maybe User }
attempt : String -> (AuthToken -> Cmd msg) -> Session -> ( List String, Cmd msg )
attempt attemptedAction toCmd session =
case Maybe.map .token session.user of
Nothing ->
( [ "You have been signed out. Please sign back in to " ++ attemptedAction ++ "." ], Cmd.none )
Just token ->
( [], toCmd token )