diff options
author | Camil Staps | 2017-10-17 08:11:35 +0200 |
---|---|---|
committer | Camil Staps | 2017-10-17 08:11:35 +0200 |
commit | c0a246c732e9bfbb2c8fe8abd55d72a4ceea4967 (patch) | |
tree | 91219197c6d938d955e7d1d9417f3d7744b92681 /assignment-6 | |
parent | Assignment 6 (diff) |
Fix authentication
Diffstat (limited to 'assignment-6')
-rw-r--r-- | assignment-6/multiplechoice.icl | 8 |
1 files changed, 7 insertions, 1 deletions
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] |