Commit 9b14cdf1 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[Admin] Easy password for users (WIP)

parent c9f764a2
...@@ -20,7 +20,7 @@ import Data.Either (Either(..)) ...@@ -20,7 +20,7 @@ import Data.Either (Either(..))
import Data.Maybe (Maybe(..)) import Data.Maybe (Maybe(..))
import Gargantext.API.Admin.Settings (withDevEnv, runCmdDev) import Gargantext.API.Admin.Settings (withDevEnv, runCmdDev)
import Gargantext.API.Prelude (GargError) import Gargantext.API.Prelude (GargError)
import Gargantext.API.Node () -- instances import Gargantext.API.Node () -- instances only
import Gargantext.Core.Types.Individu (User(..)) import Gargantext.Core.Types.Individu (User(..))
import Gargantext.Database.Action.Flow (getOrMkRoot, getOrMk_RootWithCorpus) import Gargantext.Database.Action.Flow (getOrMkRoot, getOrMk_RootWithCorpus)
import Gargantext.Database.Query.Table.Node (getOrMkList) import Gargantext.Database.Query.Table.Node (getOrMkList)
...@@ -34,6 +34,7 @@ import Gargantext.Database.Prelude (Cmd, ) ...@@ -34,6 +34,7 @@ import Gargantext.Database.Prelude (Cmd, )
import Gargantext.Prelude import Gargantext.Prelude
import System.Environment (getArgs) import System.Environment (getArgs)
-- TODO put this in gargantext.ini
secret :: Text secret :: Text
secret = "Database secret to change" secret = "Database secret to change"
...@@ -52,9 +53,12 @@ main = do ...@@ -52,9 +53,12 @@ main = do
let let
initMaster :: Cmd GargError (UserId, RootId, CorpusId, ListId) initMaster :: Cmd GargError (UserId, RootId, CorpusId, ListId)
initMaster = do initMaster = do
(masterUserId, masterRootId, masterCorpusId) <- getOrMk_RootWithCorpus (UserName userMaster) (Left corpusMasterName) (Nothing :: Maybe HyperdataCorpus) (masterUserId, masterRootId, masterCorpusId)
<- getOrMk_RootWithCorpus (UserName userMaster)
(Left corpusMasterName)
(Nothing :: Maybe HyperdataCorpus)
masterListId <- getOrMkList masterCorpusId masterUserId masterListId <- getOrMkList masterCorpusId masterUserId
_triggers <- initLastTriggers masterListId _triggers <- initLastTriggers masterListId
pure (masterUserId, masterRootId, masterCorpusId, masterListId) pure (masterUserId, masterRootId, masterCorpusId, masterListId)
withDevEnv iniPath $ \env -> do withDevEnv iniPath $ \env -> do
......
...@@ -58,6 +58,7 @@ library: ...@@ -58,6 +58,7 @@ library:
- Gargantext.Database.Admin.Types.Hyperdata - Gargantext.Database.Admin.Types.Hyperdata
- Gargantext.Database.Admin.Types.Node - Gargantext.Database.Admin.Types.Node
- Gargantext.Prelude - Gargantext.Prelude
- Gargantext.Prelude.Crypto.Pass.User
- Gargantext.Prelude.Utils - Gargantext.Prelude.Utils
- Gargantext.Core.Text - Gargantext.Core.Text
- Gargantext.Core.Text.Context - Gargantext.Core.Text.Context
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment