From 2eae90d1f837620c35e1fcfdbaf2e690e736599d Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 9 Oct 2017 13:52:54 +0200 Subject: [PATCH] Fix dummy auth --- src/Foundation.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Foundation.hs b/src/Foundation.hs index ecc31caf4..259e36048 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -237,18 +237,18 @@ instance YesodAuth UniWorX where redirectToReferer _ = True authenticate Creds{..} = runDB $ do - let auth + let (plugin, ident) | credsPlugin == "dummy" - , [ dummyPlugin, dummyIdent] <- Text.splitOn ":" credsIdent - = UniqueAuthentication dummyPlugin dummyIdent + , [dummyPlugin, dummyIdent] <- Text.splitOn ":" credsIdent + = (dummyPlugin, dummyIdent) | otherwise - = UniqueAuthentication credsPlugin credsIdent - x <- getBy auth + = (credsPlugin, credsIdent) + x <- getBy $ UniqueAuthentication plugin ident case x of Just (Entity uid _) -> return $ Authenticated uid Nothing -> Authenticated <$> insert User - { userPlugin = credsPlugin - , userIdent = credsIdent + { userPlugin = plugin + , userIdent = ident , userMatrikelnummer = "DummyMatrikel" }