caught up with conduit-0.4 and yesod-1.0
This commit is contained in:
parent
9071875e67
commit
65b085e568
@ -14,17 +14,16 @@ import Yesod.Auth
|
||||
import Yesod.Form
|
||||
import Yesod.Handler
|
||||
import Yesod.Widget
|
||||
import Text.Hamlet (shamlet)
|
||||
import Web.Authenticate.OAuth
|
||||
import Data.Maybe
|
||||
import Control.Arrow ((***))
|
||||
import Control.Monad.IO.Class
|
||||
import Data.Text (Text)
|
||||
import qualified Data.Text as T
|
||||
import Data.Text.Encoding (encodeUtf8, decodeUtf8With)
|
||||
import Data.Text.Encoding.Error (lenientDecode)
|
||||
import Data.ByteString (ByteString)
|
||||
import Control.Applicative ((<$>), (<*>))
|
||||
import Data.Conduit
|
||||
|
||||
oauthUrl :: Text -> AuthRoute
|
||||
oauthUrl name = PluginR name ["forward"]
|
||||
@ -69,14 +68,14 @@ authOAuth oauth mkCreds = AuthPlugin name dispatch login
|
||||
]
|
||||
master <- getYesod
|
||||
accTok <- lift $ getAccessToken oauth reqTok (authHttpManager master)
|
||||
creds <- resourceLiftBase $ mkCreds accTok
|
||||
creds <- liftIO $ mkCreds accTok
|
||||
setCreds True creds
|
||||
dispatch _ _ = notFound
|
||||
login tm = do
|
||||
render <- lift getUrlRender
|
||||
let oaUrl = render $ tm $ oauthUrl name
|
||||
addHtml
|
||||
[shamlet| <a href=#{oaUrl}>Login via #{name} |]
|
||||
addWidget
|
||||
[whamlet| <a href=#{oaUrl}>Login via #{name} |]
|
||||
|
||||
authTwitter :: YesodAuth m
|
||||
=> ByteString -- ^ Consumer Key
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
name: yesod-auth-oauth
|
||||
version: 0.8.1
|
||||
version: 1.0.0
|
||||
license: BSD3
|
||||
license-file: LICENSE
|
||||
author: Hiromi Ishii
|
||||
@ -20,19 +20,16 @@ library
|
||||
build-depends: base >= 4.3 && < 5
|
||||
cpp-options: -DGHC7
|
||||
else
|
||||
build-depends: base >= 4 && < 4.3
|
||||
build-depends: authenticate-oauth >= 1.1 && < 1.2
|
||||
build-depends: base >= 4 && < 4.3
|
||||
build-depends: authenticate-oauth >= 1.3 && < 1.4
|
||||
, bytestring >= 0.9.1.4 && < 0.10
|
||||
, yesod-core >= 0.10 && < 0.11
|
||||
, yesod-auth >= 0.8 && < 0.9
|
||||
, yesod-core >= 1.0 && < 1.1
|
||||
, yesod-auth >= 1.0 && < 1.1
|
||||
, text >= 0.7 && < 0.12
|
||||
, hamlet >= 0.10 && < 0.11
|
||||
, conduit >= 0.2 && < 0.3
|
||||
, yesod-form >= 0.4 && < 0.5
|
||||
|
||||
, yesod-form >= 1.0 && < 1.1
|
||||
, transformers >= 0.2.2 && < 0.3
|
||||
exposed-modules: Yesod.Auth.OAuth
|
||||
ghc-options: -Wall
|
||||
include-dirs: include
|
||||
|
||||
source-repository head
|
||||
type: git
|
||||
|
||||
Loading…
Reference in New Issue
Block a user