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