From 9d57e149fcb124a28813c56f83cf254eb92baa42 Mon Sep 17 00:00:00 2001 From: Joris Date: Fri, 11 Mar 2016 23:21:06 +0100 Subject: Don't use persona anymore, use email token to sign in --- src/client/elm/Update.elm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/client/elm/Update.elm') diff --git a/src/client/elm/Update.elm b/src/client/elm/Update.elm index bfc3bf6..948ab1f 100644 --- a/src/client/elm/Update.elm +++ b/src/client/elm/Update.elm @@ -20,6 +20,8 @@ import Model.View.LoggedInView exposing (..) import Update.LoggedIn exposing (updateLoggedIn) import Update.SignIn exposing (updateSignIn) +import Utils.Http exposing (errorKey) + update : Action -> Model -> (Model, Effects Action) update action model = case action of @@ -27,12 +29,13 @@ update action model = NoOp -> (model, Effects.none) - SignIn assertion -> + SignIn email -> ( applySignIn model (SignInAction.WaitingServer) - , Server.signIn assertion + , Server.signIn email |> Task.map GoLoggedInView - |> flip Task.onError (\_ -> - Task.succeed (UpdateSignIn (SignInAction.ErrorLogin (getMessage "ErrorSignIn" model.translations))) + |> flip Task.onError (\error -> + let errorMessage = getMessage (errorKey error) model.translations + in Task.succeed (UpdateSignIn (SignInAction.ErrorLogin errorMessage)) ) |> Effects.task ) -- cgit v1.2.3