This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loginUser | |
:: ByteString | |
-- ^ Username field | |
-> ByteString | |
-- ^ Password field | |
-> Maybe ByteString | |
-- ^ Remember field; Nothing if you want no remember function. | |
-> (AuthFailure -> Handler b (AuthManager b) ()) | |
-- ^ Upon failure | |
-> Handler b (AuthManager b) () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
createUser :: Text -- ^ Username | |
-> ByteString -- ^ Password | |
-> Handler b (AuthManager b) (Either String AuthUser) | |
createUser "" _ = return $ Left "Username cannot be empty" | |
createUser unm pwd = withBackend $ \r -> do | |
u <- liftIO $ buildAuthUser r unm pwd | |
return $ Right u |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FLASK: | |
#!/usr/bin/env python | |
# A github post-receive hook handler, runs some shell command on each HTTP POST to PORT. | |
# github-listener.py PORT 'SOME SHELL COMMAND' | |
import sys | |
from subprocess import * | |
from flask import Flask |