Improve PIN send

This commit is contained in:
Rene Vergara 2023-10-10 11:12:58 -05:00
parent a2654a6f01
commit f5dbde0ed6
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2

View file

@ -372,12 +372,7 @@ listCountries :: Action IO [Document]
listCountries = rest =<< find (select [] "countries")
sendPin ::
BS.ByteString
-> BS.ByteString
-> T.Text
-> T.Text
-> T.Text
-> Action IO String
BS.ByteString -> BS.ByteString -> T.Text -> T.Text -> T.Text -> IO String
sendPin nodeUser nodePwd nodeAddress addr pin = do
let pd =
[ Data.Aeson.String nodeAddress
@ -414,7 +409,7 @@ addUser nodeUser nodePwd p db node (Just tx) = do
isNew <- liftIO $ isUserNew p db tx
when isNew $ do
newPin <- liftIO generatePin
_ <- sendPin nodeUser nodePwd node (address tx) (T.pack newPin)
_ <- liftIO $ sendPin nodeUser nodePwd node (address tx) (T.pack newPin)
let pinHash =
BLK.hash
[ BA.pack . BS.unpack . C.pack . T.unpack $