Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
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
gargantext
haskell-gargantext
Commits
b18c4919
Commit
b18c4919
authored
Jan 21, 2021
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] normalize username when sharing
parent
47ab0d5b
Pipeline
#1374
failed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
New.hs
src/Gargantext/Database/Action/User/New.hs
+4
-2
No files found.
src/Gargantext/Database/Action/User/New.hs
View file @
b18c4919
...
...
@@ -25,7 +25,7 @@ import Gargantext.Database.Query.Table.User
import
Gargantext.Prelude
import
Gargantext.Prelude.Config
import
Gargantext.Prelude.Crypto.Pass.User
(
gargPass
)
import
qualified
Data.Text
as
Text
------------------------------------------------------------------------
------------------------------------------------------------------------
newUsers
::
(
CmdM
env
err
m
,
MonadRandom
m
,
HasNodeError
err
)
...
...
@@ -45,9 +45,11 @@ newUserQuick n = do
pure
(
NewUser
u
n
(
GargPassword
pass
))
------------------------------------------------------------------------
-- | guessUserName
-- guess username and normalize it (Text.toLower)
guessUserName
::
Text
->
Maybe
(
Text
,
Text
)
guessUserName
n
=
case
splitOn
"@"
n
of
[
u'
,
m'
]
->
if
m'
/=
""
then
Just
(
u'
,
m'
)
[
u'
,
m'
]
->
if
m'
/=
""
then
Just
(
Text
.
toLower
u'
,
m'
)
else
Nothing
_
->
Nothing
------------------------------------------------------------------------
...
...
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