From a6bea7f767b14d65d5c11a06d1b304b8b7720b2f Mon Sep 17 00:00:00 2001 From: Michael Alan Dorman Date: Sun, 23 Aug 2015 12:33:25 -0400 Subject: [PATCH] Fix issue with yesod-core > 1.4.13. yesod-core-1.4.14 changed the Template Haskell behind the expansion of mkYesodData, such that it now must have the application data type declared before it is called. This change simply moves the call to mkYesodData to be after the data type it wants to access is declared. https://github.com/yesodweb/yesod/issues/1059 has some discussion of the issue from the Yesod side. --- Assistant/WebApp/Types.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assistant/WebApp/Types.hs b/Assistant/WebApp/Types.hs index ea5150be98..895a978b1b 100644 --- a/Assistant/WebApp/Types.hs +++ b/Assistant/WebApp/Types.hs @@ -36,8 +36,6 @@ publicFiles "static" staticRoutes :: Static staticRoutes = $(embed "static") -mkYesodData "WebApp" $(parseRoutesFile "Assistant/WebApp/routes") - data WebApp = WebApp { assistantData :: AssistantData , authToken :: AuthToken @@ -49,6 +47,8 @@ data WebApp = WebApp , listenHost ::Maybe HostName } +mkYesodData "WebApp" $(parseRoutesFile "Assistant/WebApp/routes") + instance Yesod WebApp where {- Require an auth token be set when accessing any (non-static) route -} isAuthorized _ _ = checkAuthToken authToken