Fix issue of multiple auth calls from WooCommerce
This commit is contained in:
parent
3683567b81
commit
be716378f0
1 changed files with 20 additions and 8 deletions
|
@ -644,14 +644,26 @@ routes pipe config = do
|
||||||
, "message" .= ("Authorized!" :: String)
|
, "message" .= ("Authorized!" :: String)
|
||||||
])
|
])
|
||||||
else do
|
else do
|
||||||
status accepted202
|
if (E.decodeUtf8With lenientDecode .
|
||||||
Web.Scotty.json
|
B64.decodeLenient . C.pack . T.unpack)
|
||||||
(object
|
siteurl ==
|
||||||
[ "authorized" .= False
|
fromMaybe "" (w_url c)
|
||||||
, "message" .=
|
then do
|
||||||
("ZGo shop already linked to" <>
|
status ok200
|
||||||
fromMaybe "" (w_url c))
|
Web.Scotty.json
|
||||||
])
|
(object
|
||||||
|
[ "authorized" .= True
|
||||||
|
, "message" .= ("Already authorized." :: String)
|
||||||
|
])
|
||||||
|
else do
|
||||||
|
status accepted202
|
||||||
|
Web.Scotty.json
|
||||||
|
(object
|
||||||
|
[ "authorized" .= False
|
||||||
|
, "message" .=
|
||||||
|
("ZGo shop already linked to " <>
|
||||||
|
fromMaybe "" (w_url c))
|
||||||
|
])
|
||||||
else do
|
else do
|
||||||
status accepted202
|
status accepted202
|
||||||
Web.Scotty.json
|
Web.Scotty.json
|
||||||
|
|
Loading…
Reference in a new issue