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
152
Issues
152
List
Board
Labels
Milestones
Merge Requests
9
Merge Requests
9
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
a0c1c328
Commit
a0c1c328
authored
Mar 04, 2022
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FEAT] updateUsersPassword
parent
e21e92ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
New.hs
src/Gargantext/Database/Action/User/New.hs
+14
-2
No files found.
src/Gargantext/Database/Action/User/New.hs
View file @
a0c1c328
...
...
@@ -27,7 +27,7 @@ import Gargantext.Database.Query.Table.User
import
Gargantext.Prelude
import
Gargantext.Prelude.Crypto.Pass.User
(
gargPass
)
import
Gargantext.Prelude.Mail.Types
(
MailConfig
)
------------------------------------------------------------------------
------------------------------------------------------------------------
newUsers
::
(
CmdM
env
err
m
,
MonadRandom
m
,
HasNodeError
err
,
HasMail
env
)
=>
[
EmailAddress
]
->
m
Int64
...
...
@@ -35,6 +35,18 @@ newUsers us = do
us'
<-
mapM
newUserQuick
us
config
<-
view
$
mailSettings
newUsers'
config
us'
------------------------------------------------------------------------
updateUsersPassword
::
(
CmdM
env
err
m
,
MonadRandom
m
,
HasNodeError
err
,
HasMail
env
)
=>
[
EmailAddress
]
->
m
Int64
updateUsersPassword
us
=
do
us'
<-
mapM
newUserQuick
us
config
<-
view
$
mailSettings
_
<-
mapM
(
\
u
->
updateUser
(
SendEmail
True
)
config
u
)
us'
pure
1
------------------------------------------------------------------------
------------------------------------------------------------------------
newUserQuick
::
(
MonadRandom
m
)
=>
Text
->
m
(
NewUser
GargPassword
)
...
...
@@ -44,6 +56,7 @@ newUserQuick n = do
Just
(
u'
,
_m
)
->
u'
Nothing
->
panic
"[G.D.A.U.N.newUserQuick]: Email invalid"
pure
(
NewUser
u
n
(
GargPassword
pass
))
------------------------------------------------------------------------
------------------------------------------------------------------------
-- | guessUserName
...
...
@@ -68,7 +81,6 @@ newUsers' cfg us = do
printDebug
"newUsers'"
us
pure
r
------------------------------------------------------------------------
updateUser
::
HasNodeError
err
=>
SendEmail
->
MailConfig
->
NewUser
GargPassword
->
Cmd
err
Int64
updateUser
(
SendEmail
send
)
cfg
u
=
do
...
...
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