Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
0df3ec78
Commit
0df3ec78
authored
Oct 03, 2022
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] if username or password have space in it
parent
7cb79ded
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
7 deletions
+22
-7
install
install
+8
-0
Form.purs
src/Gargantext/Components/Login/Form.purs
+14
-7
No files found.
install
0 → 100755
View file @
0df3ec78
#!/bin/bash
# To get infos
# nix-shell -p nix-info --run "nix-info -m"
nix-channel
--update
nix-env
-iA
nixpkgs.nix nixpkgs.cacert
nix-shell
--show-trace
--option
build-fallback
true
--run
build
src/Gargantext/Components/Login/Form.purs
View file @
0df3ec78
...
@@ -12,6 +12,7 @@ import Reactix.SyntheticEvent as E
...
@@ -12,6 +12,7 @@ import Reactix.SyntheticEvent as E
import Reactix.DOM.HTML as H
import Reactix.DOM.HTML as H
import Toestand as T
import Toestand as T
import Toestand (useFocusedFields)
import Toestand (useFocusedFields)
import Data.String as String
import Gargantext.Components.Forms (clearfix, formGroup)
import Gargantext.Components.Forms (clearfix, formGroup)
import Gargantext.Components.Login.Types (AuthRequest(..), FormType(..))
import Gargantext.Components.Login.Types (AuthRequest(..), FormType(..))
...
@@ -85,12 +86,11 @@ formLoginLink backend =
...
@@ -85,12 +86,11 @@ formLoginLink backend =
type SubmitButtonProps s v = ( cell :: T.Box Form | Props s v )
type SubmitButtonProps s v = ( cell :: T.Box Form | Props s v )
submitButton
submitButton :: forall s v. T.ReadWrite s Sessions => T.Write v Boolean
:: forall s v. T.ReadWrite s Sessions => T.Write v Boolean
=> R2.Leaf (SubmitButtonProps s v)
=> R2.Leaf (SubmitButtonProps s v)
submitButton = R2.leafComponent submitButtonCpt
submitButton = R2.leafComponent submitButtonCpt
submitButtonCpt
:: forall s v. T.ReadWrite s Sessions => T.Write v Boolean
submitButtonCpt
:: forall s v. T.ReadWrite s Sessions => T.Write v Boolean
=> R.Component (SubmitButtonProps s v)
=> R.Component (SubmitButtonProps s v)
submitButtonCpt = here.component "submitButton" cpt where
submitButtonCpt = here.component "submitButton" cpt where
cpt { backend, formType, sessions, visible, cell } _ = do
cpt { backend, formType, sessions, visible, cell } _ = do
...
@@ -115,7 +115,14 @@ submitForm { backend, sessions, visible } cell e = do
...
@@ -115,7 +115,14 @@ submitForm { backend, sessions, visible } cell e = do
*> T.write false visible
*> T.write false visible
*> T.write (state { error = "" }) cell
*> T.write (state { error = "" }) cell
where
where
req { username, password } = AuthRequest { username, password }
-- User usually copy space before or after the username and password
req { username, password } = AuthRequest {username:cleanString username, password:cleanString password }
-- req { username, password } = AuthRequest {username, password }
cleanString :: String -> String
cleanString str = String.replace (String.Pattern " ")
(String.Replacement "") str
csrfTokenInput :: R.Element -- TODO hard-coded CSRF token
csrfTokenInput :: R.Element -- TODO hard-coded CSRF token
csrfTokenInput = H.input { type: "hidden", name, value } where
csrfTokenInput = H.input { type: "hidden", name, value } where
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment