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
b21a965d
Commit
b21a965d
authored
Oct 18, 2019
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
ssh://gitlab.iscpif.fr:20022/gargantext/purescript-gargantext
into dev
parents
4e38bda1
9bfdbf60
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
10 deletions
+7
-10
REST.purs
src/Gargantext/Config/REST.purs
+1
-2
Ends.purs
src/Gargantext/Ends.purs
+1
-1
Sessions.purs
src/Gargantext/Sessions.purs
+5
-7
No files found.
src/Gargantext/Config/REST.purs
View file @
b21a965d
module Gargantext.Config.REST where
import Gargantext.Prelude
import Gargantext.Ends
import Prelude (Unit, bind, logs, pure, ($), (<$>), (<<<), (<>))
import Affjax (defaultRequest, printResponseFormatError, request)
import Affjax.RequestBody (RequestBody(..), string)
...
...
src/Gargantext/Ends.purs
View file @
b21a965d
...
...
@@ -4,7 +4,7 @@ module Gargantext.Ends
where
import Prelude (class Eq, class Show, identity, show, ($), (<>), bind, pure, (<<<), (==))
import Data.Argonaut ( class DecodeJson, decodeJson, class EncodeJson,
encodeJson,
(:=), (~>), jsonEmptyObject, (.:))
import Data.Argonaut ( class DecodeJson, decodeJson, class EncodeJson, (:=), (~>), jsonEmptyObject, (.:))
import Data.Foldable (foldMap)
import Data.Generic.Rep (class Generic)
import Data.Generic.Rep.Eq (genericEq)
...
...
src/Gargantext/Sessions.purs
View file @
b21a965d
-- | A module for authenticating to create sessions and handling them
module Gargantext.Sessions where
import Prelude (class Eq, class Show, Unit, const, otherwise, pure, show, unit, ($), (*>), (<*), (<$>), (<>), (==), (/=), (>>=), (>=>), (<<<), bind, map)
import Control.Monad.Except (runExcept)
import Data.Argonaut ( class DecodeJson, decodeJson, class EncodeJson, encodeJson, (:=), (~>), (.:), Json)
import Prelude (class Eq, class Show, Unit, const, otherwise, pure, show, unit, ($), (*>), (<*), (<$>), (<>), (==), (/=), (>>=), (<<<), bind)
import Data.Argonaut ( class DecodeJson, decodeJson, class EncodeJson, encodeJson, (:=), (~>), (.:))
import Data.Argonaut.Core (Json, fromArray, jsonEmptyObject, stringify)
import Data.Argonaut.Parser (jsonParser)
import Data.Array as A
...
...
@@ -26,7 +25,6 @@ import Gargantext.Components.Login.Types
import Gargantext.Config.REST as REST
import Gargantext.Ends (class ToUrl, Backend, backendUrl, toUrl, sessionPath)
import Gargantext.Routes (SessionRoute)
import Gargantext.Prelude (logs)
import Gargantext.Types (NodePath, SessionId(..), nodePath)
import Gargantext.Utils.Reactix as R2
...
...
@@ -100,7 +98,7 @@ instance decodeJsonSessions :: DecodeJson Sessions where
where
decodeSessions :: Json -> Either String (Array Session)
decodeSessions json
= decodeJson json
decodeSessions json
2 = decodeJson json2
>>= \obj -> obj .: "sessions"
>>= traverse decodeJson
...
...
@@ -192,10 +190,10 @@ mapLeft _ (Right r) = Right r
saveSessions :: Sessions -> Effect Sessions
saveSessions sessions = effect *> pure sessions where
rem
ove
= getls >>= removeItem localStorageKey
rem = getls >>= removeItem localStorageKey
set v = getls >>= setItem localStorageKey v
effect
| null sessions = rem
ove
| null sessions = rem
| otherwise = set (stringify $ encodeJson sessions)
postAuthRequest :: Backend -> AuthRequest -> Aff (Either String Session)
...
...
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