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
160
Issues
160
List
Board
Labels
Milestones
Merge Requests
14
Merge Requests
14
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
f860b55e
Commit
f860b55e
authored
Apr 28, 2022
by
Karen Konou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[GQL] Do not erase types when comapring NodeIds
parent
4898b67a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
UserInfo.hs
src/Gargantext/API/GraphQL/UserInfo.hs
+1
-2
Utils.hs
src/Gargantext/API/GraphQL/Utils.hs
+3
-3
No files found.
src/Gargantext/API/GraphQL/UserInfo.hs
View file @
f860b55e
...
...
@@ -47,7 +47,6 @@ import Gargantext.Prelude
import
GHC.Generics
(
Generic
)
import
Gargantext.API.GraphQL.Utils
(
AuthStatus
(
Invalid
,
Valid
),
authUser
)
import
Gargantext.API.Admin.Types
(
HasSettings
)
import
Gargantext.Database.Admin.Types.Node
(
unNodeId
)
data
UserInfo
=
UserInfo
{
ui_id
::
Int
...
...
@@ -152,7 +151,7 @@ updateUserInfo (UserInfoMArgs { ui_id, .. }) = do
uh
lens'
(
Just
val
)
u_hyperdata
=
u_hyperdata
&
lens'
.~
Just
val
uh'
_
Nothing
u_hyperdata
=
u_hyperdata
uh'
lens'
(
Just
val
)
u_hyperdata
=
u_hyperdata
&
lens'
.~
val
nId
Node
{
_node_id
}
=
unNodeId
_node_id
nId
Node
{
_node_id
}
=
_node_id
-- | Inner function to fetch the user from DB.
dbUsers
...
...
src/Gargantext/API/GraphQL/Utils.hs
View file @
f860b55e
...
...
@@ -22,7 +22,7 @@ import Control.Lens.Getter (view)
import
Gargantext.Database.Prelude
(
Cmd
'
)
import
Gargantext.API.Admin.Auth.Types
(
AuthenticatedUser
(
AuthenticatedUser
,
_authUser_id
))
import
Data.ByteString
(
ByteString
)
import
Gargantext.Database.Admin.Types.Node
(
un
NodeId
)
import
Gargantext.Database.Admin.Types.Node
(
NodeId
)
unPrefix
::
T
.
Text
->
GQLTypeOptions
->
GQLTypeOptions
unPrefix
prefix
options
=
options
{
fieldLabelModifier
=
nflm
}
...
...
@@ -31,7 +31,7 @@ unPrefix prefix options = options { fieldLabelModifier = nflm }
data
AuthStatus
=
Valid
|
Invalid
authUser
::
(
HasSettings
env
)
=>
Int
->
Text
->
Cmd'
env
err
AuthStatus
authUser
::
(
HasSettings
env
)
=>
NodeId
->
Text
->
Cmd'
env
err
AuthStatus
authUser
ui_id
token
=
do
let
token'
=
encodeUtf8
token
jwtS
<-
view
$
settings
.
jwtSettings
...
...
@@ -43,7 +43,7 @@ authUser ui_id token = do
then
pure
Valid
else
pure
Invalid
where
nId
AuthenticatedUser
{
_authUser_id
}
=
unNodeId
_authUser_id
nId
AuthenticatedUser
{
_authUser_id
}
=
_authUser_id
getUserFromToken
::
JWTSettings
->
ByteString
->
IO
(
Maybe
AuthenticatedUser
)
getUserFromToken
=
verifyJWT
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