Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
988ba3f6
Commit
988ba3f6
authored
Jan 24, 2020
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: objection 2 changes
parent
e7b54573
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
auth.js
server/core/auth.js
+1
-1
pageHistory.js
server/models/pageHistory.js
+2
-2
pages.js
server/models/pages.js
+2
-2
users.js
server/models/users.js
+2
-2
No files found.
server/core/auth.js
View file @
988ba3f6
...
...
@@ -30,7 +30,7 @@ module.exports = {
passport
.
deserializeUser
(
async
(
id
,
done
)
=>
{
try
{
const
user
=
await
WIKI
.
models
.
users
.
query
().
findById
(
id
).
modifyEager
(
'groups'
,
builder
=>
{
const
user
=
await
WIKI
.
models
.
users
.
query
().
findById
(
id
).
withGraphFetched
(
'groups'
).
modifyGraph
(
'groups'
,
builder
=>
{
builder
.
select
(
'groups.id'
,
'permissions'
)
})
if
(
user
)
{
...
...
server/models/pageHistory.js
View file @
988ba3f6
...
...
@@ -116,7 +116,7 @@ module.exports = class PageHistory extends Model {
authorName
:
'author.name'
}
])
.
joinRelat
ion
(
'author'
)
.
joinRelat
ed
(
'author'
)
.
where
({
'pageHistory.pageId'
:
pageId
})
...
...
@@ -138,7 +138,7 @@ module.exports = class PageHistory extends Model {
authorName
:
'author.name'
}
])
.
joinRelat
ion
(
'author'
)
.
joinRelat
ed
(
'author'
)
.
where
({
'pageHistory.pageId'
:
pageId
})
...
...
server/models/pages.js
View file @
988ba3f6
...
...
@@ -702,8 +702,8 @@ module.exports = class Page extends Model {
creatorEmail
:
'creator.email'
}
])
.
joinRelat
ion
(
'author'
)
.
joinRelat
ion
(
'creator'
)
.
joinRelat
ed
(
'author'
)
.
joinRelat
ed
(
'creator'
)
.
eagerAlgorithm
(
Model
.
JoinEagerAlgorithm
)
.
eager
(
'tags(selectTags)'
,
{
selectTags
:
builder
=>
{
...
...
server/models/users.js
View file @
988ba3f6
...
...
@@ -331,7 +331,7 @@ module.exports = class User extends Model {
static
async
refreshToken
(
user
)
{
if
(
_
.
isSafeInteger
(
user
))
{
user
=
await
WIKI
.
models
.
users
.
query
().
findById
(
user
).
eager
(
'groups'
).
modifyEager
(
'groups'
,
builder
=>
{
user
=
await
WIKI
.
models
.
users
.
query
().
findById
(
user
).
withGraphFetched
(
'groups'
).
modifyGraph
(
'groups'
,
builder
=>
{
builder
.
select
(
'groups.id'
,
'permissions'
)
})
if
(
!
user
)
{
...
...
@@ -339,7 +339,7 @@ module.exports = class User extends Model {
throw
new
WIKI
.
Error
.
AuthGenericError
()
}
}
else
if
(
_
.
isNil
(
user
.
groups
))
{
await
user
.
$relatedQuery
(
'groups'
).
select
(
'groups.id'
,
'permissions'
)
user
.
groups
=
await
user
.
$relatedQuery
(
'groups'
).
select
(
'groups.id'
,
'permissions'
)
}
return
{
...
...
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