yesod changes
This commit is contained in:
parent
46d8398d7a
commit
881ea26d83
@ -94,9 +94,7 @@ setCreds doRedirects creds = do
|
|||||||
then do
|
then do
|
||||||
case authRoute y of
|
case authRoute y of
|
||||||
Nothing -> do
|
Nothing -> do
|
||||||
rh <- defaultLayout $ addBody [$hamlet|
|
rh <- defaultLayout [$hamlet|%h1 Invalid login|]
|
||||||
%h1 Invalid login
|
|
||||||
|]
|
|
||||||
sendResponse rh
|
sendResponse rh
|
||||||
Just ar -> do
|
Just ar -> do
|
||||||
setMessage $ string "Invalid login"
|
setMessage $ string "Invalid login"
|
||||||
@ -115,7 +113,7 @@ getCheckR = do
|
|||||||
creds <- maybeAuthId
|
creds <- maybeAuthId
|
||||||
defaultLayoutJson (do
|
defaultLayoutJson (do
|
||||||
setTitle $ string "Authentication Status"
|
setTitle $ string "Authentication Status"
|
||||||
addBody $ html creds) (json creds)
|
addHtml $ html creds) (json creds)
|
||||||
where
|
where
|
||||||
html creds = [$hamlet|
|
html creds = [$hamlet|
|
||||||
%h1 Authentication Status
|
%h1 Authentication Status
|
||||||
|
|||||||
@ -18,8 +18,7 @@ authDummy =
|
|||||||
setCreds True $ Creds "dummy" ident []
|
setCreds True $ Creds "dummy" ident []
|
||||||
dispatch _ _ = notFound
|
dispatch _ _ = notFound
|
||||||
url = PluginR "dummy" []
|
url = PluginR "dummy" []
|
||||||
login authToMaster = do
|
login authToMaster = [$hamlet|
|
||||||
addBody [$hamlet|
|
|
||||||
%form!method=post!action=@authToMaster.url@
|
%form!method=post!action=@authToMaster.url@
|
||||||
Your new identifier is: $
|
Your new identifier is: $
|
||||||
%input!type=text!name=ident
|
%input!type=text!name=ident
|
||||||
|
|||||||
@ -76,8 +76,7 @@ authEmail =
|
|||||||
dispatch "POST" ["set-password"] = go postPasswordR
|
dispatch "POST" ["set-password"] = go postPasswordR
|
||||||
dispatch _ _ = notFound
|
dispatch _ _ = notFound
|
||||||
|
|
||||||
login' tm = do
|
login' tm = [$hamlet|
|
||||||
addBody [$hamlet|
|
|
||||||
%form!method=post!action=@tm.login@
|
%form!method=post!action=@tm.login@
|
||||||
%table
|
%table
|
||||||
%tr
|
%tr
|
||||||
@ -99,7 +98,7 @@ getRegisterR = do
|
|||||||
toMaster <- getRouteToMaster
|
toMaster <- getRouteToMaster
|
||||||
defaultLayout $ do
|
defaultLayout $ do
|
||||||
setTitle $ string "Register a new account"
|
setTitle $ string "Register a new account"
|
||||||
addBody [$hamlet|
|
addHamlet [$hamlet|
|
||||||
%p Enter your e-mail address below, and a confirmation e-mail will be sent to you.
|
%p Enter your e-mail address below, and a confirmation e-mail will be sent to you.
|
||||||
%form!method=post!action=@toMaster.register@
|
%form!method=post!action=@toMaster.register@
|
||||||
%label!for=email E-mail
|
%label!for=email E-mail
|
||||||
@ -129,7 +128,7 @@ postRegisterR = do
|
|||||||
sendVerifyEmail email verKey verUrl
|
sendVerifyEmail email verKey verUrl
|
||||||
defaultLayout $ do
|
defaultLayout $ do
|
||||||
setTitle $ string "Confirmation e-mail sent"
|
setTitle $ string "Confirmation e-mail sent"
|
||||||
addBody [$hamlet|
|
addWidget [$hamlet|
|
||||||
%p A confirmation e-mail has been sent to $email$.
|
%p A confirmation e-mail has been sent to $email$.
|
||||||
|]
|
|]
|
||||||
|
|
||||||
@ -151,7 +150,7 @@ getVerifyR lid key = do
|
|||||||
_ -> return ()
|
_ -> return ()
|
||||||
defaultLayout $ do
|
defaultLayout $ do
|
||||||
setTitle $ string "Invalid verification key"
|
setTitle $ string "Invalid verification key"
|
||||||
addBody [$hamlet|
|
addHtml [$hamlet|
|
||||||
%p I'm sorry, but that was an invalid verification key.
|
%p I'm sorry, but that was an invalid verification key.
|
||||||
|]
|
|]
|
||||||
|
|
||||||
@ -191,7 +190,7 @@ getPasswordR = do
|
|||||||
redirect RedirectTemporary $ toMaster login
|
redirect RedirectTemporary $ toMaster login
|
||||||
defaultLayout $ do
|
defaultLayout $ do
|
||||||
setTitle $ string "Set password"
|
setTitle $ string "Set password"
|
||||||
addBody [$hamlet|
|
addHamlet [$hamlet|
|
||||||
%h3 Set a new password
|
%h3 Set a new password
|
||||||
%form!method=post!action=@toMaster.setpass@
|
%form!method=post!action=@toMaster.setpass@
|
||||||
%table
|
%table
|
||||||
|
|||||||
@ -53,7 +53,7 @@ authFacebook cid secret perms =
|
|||||||
render <- liftHandler getUrlRender
|
render <- liftHandler getUrlRender
|
||||||
let fb = Facebook.Facebook cid secret $ render $ tm url
|
let fb = Facebook.Facebook cid secret $ render $ tm url
|
||||||
let furl = Facebook.getForwardUrl fb $ perms
|
let furl = Facebook.getForwardUrl fb $ perms
|
||||||
addBody [$hamlet|
|
addHtml [$hamlet|
|
||||||
%p
|
%p
|
||||||
%a!href=$furl$ Login with Facebook
|
%a!href=$furl$ Login with Facebook
|
||||||
|]
|
|]
|
||||||
|
|||||||
@ -20,12 +20,12 @@ authOpenId =
|
|||||||
name = "openid_identifier"
|
name = "openid_identifier"
|
||||||
login tm = do
|
login tm = do
|
||||||
ident <- newIdent
|
ident <- newIdent
|
||||||
addStyle [$cassius|
|
addCassius [$cassius|
|
||||||
#$ident$
|
#$ident$
|
||||||
background: #fff url(http://www.myopenid.com/static/openid-icon-small.gif) no-repeat scroll 0pt 50%;
|
background: #fff url(http://www.myopenid.com/static/openid-icon-small.gif) no-repeat scroll 0pt 50%;
|
||||||
padding-left: 18px;
|
padding-left: 18px;
|
||||||
|]
|
|]
|
||||||
addBody [$hamlet|
|
addHamlet [$hamlet|
|
||||||
%form!method=get!action=@tm.forwardUrl@
|
%form!method=get!action=@tm.forwardUrl@
|
||||||
%label!for=openid OpenID: $
|
%label!for=openid OpenID: $
|
||||||
%input#$ident$!type=text!name=$name$!value="http://"
|
%input#$ident$!type=text!name=$name$!value="http://"
|
||||||
|
|||||||
@ -17,7 +17,7 @@ authRpxnow app apiKey =
|
|||||||
where
|
where
|
||||||
login tm = do
|
login tm = do
|
||||||
let url = {- FIXME urlEncode $ -} tm $ PluginR "rpxnow" []
|
let url = {- FIXME urlEncode $ -} tm $ PluginR "rpxnow" []
|
||||||
addBody [$hamlet|
|
addHamlet [$hamlet|
|
||||||
%iframe!src="http://$app$.rpxnow.com/openid/embed?token_url=@url@"!scrolling=no!frameBorder=no!allowtransparency=true!style="width:400px;height:240px"
|
%iframe!src="http://$app$.rpxnow.com/openid/embed?token_url=@url@"!scrolling=no!frameBorder=no!allowtransparency=true!style="width:400px;height:240px"
|
||||||
|]
|
|]
|
||||||
dispatch _ [] = do
|
dispatch _ [] = do
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user