<div class="gmail_quote">I seem to be having an issue where getAuthId (when being instantiated under YesodAuth) is never being executed on my site, which basically prevents the necessary data from being inserted into the database and the AuthId being set up (or the Auth system working in general, at all). I&#39;m not sure if this is an issue with Haskell&#39;s lazy evaluation, browsing through the source code I note that getAuthId is called by setCreds, which is inturn called when you instantiate an authentication plugin (in my case I am using facebook)). <div>


<br></div><div>I am using a simple liftIO$ putStrLn &quot;getAuthId&quot; inside the getAuthId to figure out if the function is being called (and I never manage to get Haskell to execute it). Furthermore nothing is being entered into my database (which would happen if its called). Originally I used to think this was due to Haskell&#39;s laziness or black magic, (I was initiating maybeAuth but never using the variable), I then forced evaluation of maybeAuth, obviously with no results (and maybeAuth always returns Nothing).<br>

<div><br></div><div>The actual logging into facebook and redirecting works fine.</div>
</div><div><br></div><div>I am using yesod-auth-0.42 with authenticate 0.9.0.1 and yesod 0.8.1</div><div><br></div><div>Also on another note (since I am unable to test it right now), if I wish to get data from facebook using the graph API (in my case I am doing this inside getAuthId as well), something like this is done?</div>

<div><br></div><div>let [(_,at)] = credsExtra creds</div><div>fbname &lt;- liftIO $ getTextFBData at &quot;name&quot;</div><div><br></div><div>where getTextFBData is defined as</div><div><br></div><div><div>textFromJSON :: Value -&gt; T.Text</div>

<div>textFromJSON v = case (fromJSON v) of</div><div>                Success a -&gt; a</div><div>                Error b -&gt; T.pack b</div><div><br></div><div>getTextFBData :: T.Text -&gt; T.Text -&gt; IO (T.Text)</div>

<div>getTextFBData at rq = do</div><div>    let at&#39; = AccessToken at</div><div>    rqeither &lt;- liftIO $ getGraphData at&#39; rq</div><div>    return (either (\x-&gt; &quot;invalid request from FB&quot;) textFromJSON rqeither)</div>

</div>
</div><br>