yesod-auth 1.3.4.4 → 1.3.4.5
raw patch · 2 files changed
+4/−2 lines, 2 filesnew-uploaderPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Yesod.Auth.Email: class (YesodAuth site, PathPiece (AuthEmailId site), RenderMessage site AuthMessage) => YesodAuthEmail site where type family AuthEmailId site randomKey _ = do { stdgen <- newStdGen; return $ pack $ fst $ randomString 10 stdgen } needOldPassword aid' = do { mkey <- lookupSession loginLinkKey; case mkey >>= readMay . unpack of { Just (aidT, time) | Just aid <- fromPathPiece aidT, toPathPiece (aid `asTypeOf` aid') == toPathPiece aid' -> do { now <- liftIO getCurrentTime; return $ addUTCTime (60 * 30) time <= now } _ -> return True } } checkPasswordSecurity _ x | length x >= 3 = return $ Right () | otherwise = return $ Left "Password must be at least three characters" confirmationEmailSentResponse identifier = do { mr <- getMessageRender; messageJson401 (mr msg) $ authLayout $ do { setTitleI ConfirmationEmailSentTitle; do { (asWidgetT . toWidget) ((preEscapedText . pack) "<p>"); ((liftM (toHtml .) getMessageRender) >>= (\ urender_akYo -> (asWidgetT . toWidget) (urender_akYo msg))); (asWidgetT . toWidget) ((preEscapedText . pack) "</p>") } } } where msg = ConfirmationEmailSent identifier normalizeEmailAddress _ = toLower registerHandler = defaultRegisterHandler forgotPasswordHandler = defaultForgotPasswordHandler setPasswordHandler = defaultSetPasswordHandler
+ Yesod.Auth.Email: class (YesodAuth site, PathPiece (AuthEmailId site), RenderMessage site AuthMessage) => YesodAuthEmail site where type family AuthEmailId site randomKey _ = do { stdgen <- newStdGen; return $ pack $ fst $ randomString 10 stdgen } needOldPassword aid' = do { mkey <- lookupSession loginLinkKey; case mkey >>= readMay . unpack of { Just (aidT, time) | Just aid <- fromPathPiece aidT, toPathPiece (aid `asTypeOf` aid') == toPathPiece aid' -> do { now <- liftIO getCurrentTime; return $ addUTCTime (60 * 30) time <= now } _ -> return True } } checkPasswordSecurity _ x | length x >= 3 = return $ Right () | otherwise = return $ Left "Password must be at least three characters" confirmationEmailSentResponse identifier = do { mr <- getMessageRender; selectRep $ do { provideJsonMessage (mr msg); provideRep $ authLayout $ do { setTitleI ConfirmationEmailSentTitle; do { (asWidgetT . toWidget) ((preEscapedText . pack) "<p>"); ((liftM (toHtml .) getMessageRender) >>= (\ urender_akYo -> (asWidgetT . toWidget) (urender_akYo msg))); (asWidgetT . toWidget) ((preEscapedText . pack) "</p>") } } } } where msg = ConfirmationEmailSent identifier normalizeEmailAddress _ = toLower registerHandler = defaultRegisterHandler forgotPasswordHandler = defaultForgotPasswordHandler setPasswordHandler = defaultSetPasswordHandler
Files
- Yesod/Auth/Email.hs +3/−1
- yesod-auth.cabal +1/−1
Yesod/Auth/Email.hs view
@@ -182,7 +182,9 @@ confirmationEmailSentResponse :: Text -> HandlerT site IO TypedContent confirmationEmailSentResponse identifier = do mr <- getMessageRender- messageJson401 (mr msg) $ authLayout $ do+ selectRep $ do+ provideJsonMessage (mr msg)+ provideRep $ authLayout $ do setTitleI Msg.ConfirmationEmailSentTitle [whamlet|<p>_{msg}|] where
yesod-auth.cabal view
@@ -1,5 +1,5 @@ name: yesod-auth-version: 1.3.4.4+version: 1.3.4.5 license: MIT license-file: LICENSE author: Michael Snoyman, Patrick Brisbin