Fix OpenID for Wordpress
This commit is contained in:
parent
2a7d0d3beb
commit
d4d223f97f
@ -12,6 +12,7 @@ import OpenId2.Normalization (normalize)
|
||||
import OpenId2.Discovery (discover, Discovery (..))
|
||||
import OpenId2.Types
|
||||
import Control.Monad (unless)
|
||||
import qualified Data.Text as T
|
||||
import Data.Text.Lazy.Encoding (decodeUtf8With)
|
||||
import Data.Text.Encoding.Error (lenientDecode)
|
||||
import Data.Text.Lazy (toStrict)
|
||||
@ -41,7 +42,11 @@ getForwardUrl
|
||||
getForwardUrl openid' complete mrealm params manager = do
|
||||
let realm = fromMaybe complete mrealm
|
||||
disc <- normalize openid' >>= flip discover manager
|
||||
let helper s q = return $ s `mappend` decodeUtf8 (toByteString $ renderQueryText True $ map (second Just) q)
|
||||
let helper s q = return $ T.concat
|
||||
[ s
|
||||
, if "?" `T.isInfixOf` s then "&" else "?"
|
||||
, decodeUtf8 (toByteString $ renderQueryText False $ map (second Just) q)
|
||||
]
|
||||
case disc of
|
||||
Discovery1 server mdelegate -> helper server
|
||||
$ ("openid.mode", "checkid_setup")
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
name: authenticate
|
||||
version: 1.0.0
|
||||
version: 1.0.0.1
|
||||
license: BSD3
|
||||
license-file: LICENSE
|
||||
author: Michael Snoyman, Hiromi Ishii, Arash Rouhani
|
||||
|
||||
Loading…
Reference in New Issue
Block a user