yesod-test: use correct nonce/token key

This commit is contained in:
Michael Snoyman 2012-04-25 06:54:13 +03:00
parent 0755761834
commit 797339cbd2
2 changed files with 3 additions and 3 deletions

View File

@ -324,10 +324,10 @@ fileByLabel label path mime = do
-- Receives a CSS selector that should resolve to the form element containing the nonce.
addNonce_ :: Query -> RequestBuilder ()
addNonce_ scope = do
matches <- htmlQuery $ scope `mappend` "input[name=_nonce][type=hidden][value]"
matches <- htmlQuery $ scope `mappend` "input[name=_token][type=hidden][value]"
case matches of
[] -> failure $ "No nonce found in the current page"
element:[] -> byName "_nonce" $ head $ parseHTML element $ getAttrValue "value"
element:[] -> byName "_token" $ head $ parseHTML element $ getAttrValue "value"
_ -> failure $ "More than one nonce found in the page"
-- | For responses that display a single form, just lookup the only nonce available.

View File

@ -1,5 +1,5 @@
name: yesod-test
version: 0.2.0.2
version: 0.2.0.3
license: MIT
license-file: LICENSE
author: Nubis <nubis@woobiz.com.ar>