Commits

Anonymous committed 32a3723

Minor cleanup

  • Participants
  • Parent commits 2136322

Comments (0)

Files changed (1)

File src/Snap/Snaplet/Auth/Types.hs

 -- | The underlying encryption function, in case you need it for
 -- external processing.
 encrypt :: ByteString -> IO ByteString
-encrypt pass = encryptPass' (Pass pass) >>= unEncryptedPass
+encrypt pass = encryptPass' (Pass pass) >>= return . unEncryptedPass
 
 
 -------------------------------------------------------------------------------
 -- clear-text; it will be encrypted into a 'Encrypted'.
 setPassword :: AuthUser -> ByteString -> IO AuthUser
 setPassword au pass = do
-    pw <- encryptPass' (Pass pass)
-    return $! au { userPassword = Just (Encrypted $ unEncryptedPass pw) }
+    pw <- Encrypted <$> encrypt pass
+    return $! au { userPassword = Just pw }
 
 
 ------------------------------------------------------------------------------