Commit 63f76792 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] test ok. TODO : API info <> demo users should not be able to create accounts

parent ec36f1c3
Pipeline #1260 failed with stage
...@@ -63,7 +63,7 @@ api nId (ShareTeamParams user') = do ...@@ -63,7 +63,7 @@ api nId (ShareTeamParams user') = do
case isRegistered of case isRegistered of
Just _ -> pure u Just _ -> pure u
Nothing -> do Nothing -> do
_ <- newUsers [u] _ <- newUsers [user']
pure u pure u
fromIntegral <$> DB.shareNodeWith (ShareNodeWith_User NodeFolderShared (UserName user)) nId fromIntegral <$> DB.shareNodeWith (ShareNodeWith_User NodeFolderShared (UserName user)) nId
......
...@@ -31,7 +31,7 @@ getUserId u = do ...@@ -31,7 +31,7 @@ getUserId u = do
maybeUser <- getUserId' u maybeUser <- getUserId' u
case maybeUser of case maybeUser of
Nothing -> nodeError NoUserFound Nothing -> nodeError NoUserFound
Just u -> pure u Just u' -> pure u'
getUserId' :: HasNodeError err getUserId' :: HasNodeError err
=> User => User
......
...@@ -44,9 +44,10 @@ newUserQuick n = do ...@@ -44,9 +44,10 @@ newUserQuick n = do
pass <- gargPass pass <- gargPass
let u = case guessUserName n of let u = case guessUserName n of
Just (u', _m) -> u' Just (u', _m) -> u'
Nothing -> panic "Email invalid" Nothing -> panic "[G.D.A.U.N.newUserQuick]: Email invalid"
pure (NewUser u n (GargPassword pass)) pure (NewUser u n (GargPassword pass))
------------------------------------------------------------------------
isEmail :: Text -> Bool isEmail :: Text -> Bool
isEmail = ((==) 2) . List.length . (splitOn "@") isEmail = ((==) 2) . List.length . (splitOn "@")
......
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