diff --git a/Handler/Activate.hs b/Handler/Activate.hs index b347973..9672ab8 100644 --- a/Handler/Activate.hs +++ b/Handler/Activate.hs @@ -4,14 +4,12 @@ import Import as I getActivateR :: Text -> Handler Html getActivateR token = do - t <- runDB $ selectList [TokenToken ==. token] [] + t <- runDB $ selectFirst [TokenToken ==. token] [] case t of - [] -> do + Nothing -> do setMessage $ [shamlet|
Invalid Token!|]
       redirect $ HomeR
-    [x] -> do
+    Just x -> do
       _ <- runDB $ insert $ tokenUser (entityVal x)
       setMessage $ [shamlet|
User activated|]
       redirect $ HomeR
-    _ -> do
-      error "unexpected error"