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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
purescript-gargantext
Commits
65df5cfc
Commit
65df5cfc
authored
May 16, 2022
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[sessions] log error when it happens, on forgot user pass
parent
70d8e46d
Pipeline
#2825
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Sessions.purs
src/Gargantext/Sessions.purs
+3
-3
No files found.
src/Gargantext/Sessions.purs
View file @
65df5cfc
...
@@ -115,18 +115,18 @@ postAuthRequest :: Backend -> AuthRequest -> Aff (Either String Session)
...
@@ -115,18 +115,18 @@ postAuthRequest :: Backend -> AuthRequest -> Aff (Either String Session)
postAuthRequest backend ar@(AuthRequest {username}) =
postAuthRequest backend ar@(AuthRequest {username}) =
decode <$> REST.post Nothing (toUrl backend "auth") ar
decode <$> REST.post Nothing (toUrl backend "auth") ar
where
where
decode (Left
_err) = Left "Error when sending REST.post"
decode (Left
err) = Left $ "Error when sending REST.post: " <> show err
decode (Right (AuthResponse ar2))
decode (Right (AuthResponse ar2))
| {inval: Just (AuthInvalid {message})} <- ar2 = Left message
| {inval: Just (AuthInvalid {message})} <- ar2 = Left message
| {valid: Just (AuthData {token, tree_id, user_id})} <- ar2 =
| {valid: Just (AuthData {token, tree_id, user_id})} <- ar2 =
Right $ Session { backend, caches: Map.empty, token, treeId: tree_id, username, userId: user_id }
Right $ Session { backend, caches: Map.empty, token, treeId: tree_id, username, userId: user_id }
| otherwise = Left "Invalid response from server"
| otherwise = Left "Invalid response from server"
postForgotPasswordRequest :: Backend -> String -> Aff (Either String
String
)
postForgotPasswordRequest :: Backend -> String -> Aff (Either String
{ status :: String }
)
postForgotPasswordRequest backend email =
postForgotPasswordRequest backend email =
decode <$> REST.post Nothing (toUrl backend "forgotPassword") { email }
decode <$> REST.post Nothing (toUrl backend "forgotPassword") { email }
where
where
decode (Left
_err) = Left "Error when sending REST.post"
decode (Left
err) = Left $ "Error when sending REST.post: " <> show err
decode (Right s) = Right s
decode (Right s) = Right s
get :: forall a p. JSON.ReadForeign a => ToUrl Session p =>
get :: forall a p. JSON.ReadForeign a => ToUrl Session p =>
...
...
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