Skip to content

Commit 1d01831

Browse files
authored
Merge pull request #603 from TaloDev/develop
Release 0.87.1
2 parents 1638419 + 91b3ede commit 1d01831

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "game-services",
3-
"version": "0.87.0",
3+
"version": "0.87.1",
44
"description": "",
55
"main": "src/index.ts",
66
"scripts": {

src/services/public/user-public.service.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export default class UserPublicService extends Service {
145145
const { email, password } = req.body
146146
const em: EntityManager = req.ctx.em
147147

148-
const user = await em.getRepository(User).findOne({ email })
148+
const user = await em.getRepository(User).findOne({ email }, { populate: ['organisation.games'] })
149149
if (!user) this.handleFailedLogin(req)
150150

151151
const passwordMatches = await bcrypt.compare(password, user!.password)
@@ -185,7 +185,12 @@ export default class UserPublicService extends Service {
185185
const userAgent = req.headers['user-agent']
186186
const em: EntityManager = req.ctx.em
187187

188-
const session = await em.getRepository(UserSession).findOne({ token, userAgent }, { populate: ['user'] })
188+
const session = await em.getRepository(UserSession).findOne({
189+
token,
190+
userAgent
191+
}, {
192+
populate: ['user.organisation.games']
193+
})
189194

190195
if (!session) {
191196
req.ctx.throw(401, 'Session not found')

0 commit comments

Comments
 (0)