diff options
| author | LLLL Colonq <llll@colonq> | 2024-11-18 05:07:26 -0500 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2024-11-18 05:07:26 -0500 |
| commit | 9c363a2a66f446f474dc3e87d2b0dfaf684667f2 (patch) | |
| tree | 933c177351d815dc78c8382f6f5fb98ec8e974e9 /src | |
| parent | b1a6da461d16e45bf57d01ec77fd8ef041af7c22 (diff) | |
Let's not be silly with our JSON
Diffstat (limited to 'src')
| -rw-r--r-- | src/Main.purs | 6 | ||||
| -rw-r--r-- | src/UI.js | 1 | ||||
| -rw-r--r-- | src/UI.purs | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/Main.purs b/src/Main.purs index dd0ad07..87a3ccf 100644 --- a/src/Main.purs +++ b/src/Main.purs @@ -242,11 +242,7 @@ mainAuth = launchAff_ do { text: resp } <- fetch ("/api/firstfactor") { method: POST , headers: { "Content-Type": "application/json" } - , body: fold - [ "{\"username\":\"", user - , "\",\"password\":\"", pass - , "\"}" - ] + , body: UI.toJSON { user, pass } } res <- resp liftEffect $ log res @@ -1,2 +1,3 @@ export const _cheatLog = (a) => () => console.log(a); export const _setInterval = (delay) => (f) => () => setInterval(f, delay); +export const _toJSON = (x) => JSON.stringify(x); diff --git a/src/UI.purs b/src/UI.purs index 49d797a..17d1ca1 100644 --- a/src/UI.purs +++ b/src/UI.purs @@ -11,3 +11,7 @@ cheatLog x = liftEffect $ _cheatLog x foreign import _setInterval :: Number -> Effect Unit -> Effect Unit setInterval :: forall m. MonadEffect m => Number -> Effect Unit -> m Unit setInterval d f = liftEffect $ _setInterval d f + +foreign import _toJSON :: forall a. a -> String +toJSON :: forall a. a -> String +toJSON = _toJSON |
