--
You received this message because you are subscribed to the Google Groups "HAppS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to happs+un...@googlegroups.com.
To post to this group, send email to ha...@googlegroups.com.
Visit this group at http://groups.google.com/group/happs.
For more options, visit https://groups.google.com/d/optout.
I have a withAcid function:In Clckwrk I could see:I'm still struggling with the new way to authenticate.Hello,thanks for the help.
data Acid = Acid
{ -- acidAuthenticate :: AcidState AuthenticateState
acidProfileData :: AcidState ProfileDataState
, acidCore :: AcidState CoreState
, acidNavBar :: AcidState NavBarState
}I have a similar structure:I saw you commented acidAuthenticate. Should I remove it as well? I don't have a system of plugins like you have.
data Profiles = Profiles
{ acidAuth :: AcidState AuthenticateState,
-- acidProfile :: AcidState ProfileState,
acidProfileData :: AcidState ProfileDataState}
withAcid :: Maybe FilePath -- ^ state directory
-> (Profiles -> IO a) -- ^ action
-> IO a
withAcid mBasePath f = do
let basePath = fromMaybe "_state" mBasePath
bracket (openLocalStateFrom (basePath </> "auth") initialAuthenticateState) createCheckpointAndClose $ \auth ->
-- bracket (openLocalStateFrom (basePath </> "profile") initialProfileState) createCheckpointAndClose $ \profile ->
bracket (openLocalStateFrom (basePath </> "profileData") initialProfileDataState) createCheckpointAndClose $ \profileData ->
f (Profiles auth profileData)I use withAcid in the main:main = do
...
withAcid (Just $ saveDir </> profilesDir) $ \acid -> do
tvSession <- atomically $ newTVar acid
forkIO $ launchWebServer tvSession (Network host port)Then I access the state latter:
login ts = do
(Profiles authenticateState _) <- liftIO $ atomically $ readTVar ts
mUserId <- getUserId authenticateStateThis seems to be the cause of the conflict seen before (state/authenticate/core/open.lock: Locked by 18674: resource busy).Is it still the correct way to do?Thanks,COn Mon, Jul 27, 2015 at 12:15 AM, Jeremy Shaw <jer...@seereason.com> wrote:Hello,Sorry there is not. Though it would be nice if there was :)The rewrite is very significant. It is possible to migrate the old data though by using the migrate found here:https://github.com/Happstack/happstack-authenticate-0
The aims of the new happstack-authenticate are to make it easier to:1. add alternative authentication backends (ldap, etc)2. write single page applications (aka, the server is just a JSON API, and all the rendering happens on the client)3. change the UIAt the moment, the only UI available requires angularjs. Well, this project was enough to make my first love and then hate angularjs. Fortunately, we now have ghcjs available! But, we do not have a definitive clientside haskell framework yet. Though we have two different ones in development at seereason at the moment :)Regarding the issue in the other email -- I think your conclusion is correct. The issue with the .lock file would occur if you tried to open the same acid-state files twice, which would happen if you had two different version of happstack-authenticate in the same application.
Hopefully this helps some. Sorry the documentation is not better. Knowing that I want to redo the UI in haskell instead of angularjs makes me less inclined to write really good porting documentation. Especially with no real idea of how many people are actually using the old happstack-authenticate directly and want to upgrade.- jeremyOn Wed, Jul 22, 2015 at 8:34 AM, Corentin Dupont <corenti...@gmail.com> wrote:CorentinThanks,What are the essential differences?Hi again,I'm trying to update to happstack-authenticate 2, is there a migration guide?