From c0a246c732e9bfbb2c8fe8abd55d72a4ceea4967 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Tue, 17 Oct 2017 08:11:35 +0200 Subject: Fix authentication --- assignment-6/multiplechoice.icl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'assignment-6/multiplechoice.icl') diff --git a/assignment-6/multiplechoice.icl b/assignment-6/multiplechoice.icl index 327ef21..da6690d 100644 --- a/assignment-6/multiplechoice.icl +++ b/assignment-6/multiplechoice.icl @@ -8,11 +8,17 @@ import Data.Tuple import iTasks -Start w = startEngine (allTasks createUsers >>| doAuthenticated (get currentUser >>- main)) w +Start w = startEngine (allTasks createUsers >>| authedMain) w where createUsers :: [Task UserAccount] createUsers = [catchAll (createUser u) (\_ -> return u) \\ u <- myUsers] + authedMain :: Task () + authedMain = doAuthenticated (get currentUser >>- main) >>* + [OnAllExceptions (\_ -> + viewInformation (Title "Login failed") [] "Your username or password is incorrect" + >>| authedMain)] + :: Question = { question :: String , answers :: [String] -- cgit v1.2.3