diff --git a/apps/meteor/app/api/server/default/info.ts b/apps/meteor/app/api/server/default/info.ts index 0deda662275dd..8297f90fffd98 100644 --- a/apps/meteor/app/api/server/default/info.ts +++ b/apps/meteor/app/api/server/default/info.ts @@ -1,4 +1,5 @@ import { API } from '../api'; +import { getLoggedInUser } from '../helpers/getLoggedInUser'; import { getServerInfo } from '../lib/getServerInfo'; API.default.addRoute( @@ -6,7 +7,8 @@ API.default.addRoute( { authRequired: false }, { async get() { - return API.v1.success(await getServerInfo(this.userId)); + const user = await getLoggedInUser(this.request); + return API.v1.success(await getServerInfo(user?._id)); }, }, ); diff --git a/apps/meteor/tests/end-to-end/api/00-miscellaneous.js b/apps/meteor/tests/end-to-end/api/00-miscellaneous.js index 7525fd6ab443d..c0fc4d2eb539f 100644 --- a/apps/meteor/tests/end-to-end/api/00-miscellaneous.js +++ b/apps/meteor/tests/end-to-end/api/00-miscellaneous.js @@ -24,10 +24,11 @@ describe('miscellaneous', function () { .expect('Content-Type', 'application/json') .expect(200) .expect((res) => { + expect(res.body).to.have.property('version').and.to.be.a('string'); expect(res.body.info).to.have.property('version').and.to.be.a('string'); expect(res.body.info).to.have.property('build').and.to.be.an('object'); expect(res.body.info).to.have.property('commit').and.to.be.an('object'); - expect(res.body.info).to.have.property('marketplaceApiVersion').and.to.be.a('string'); + expect(res.body).to.have.property('marketplaceApiVersion').and.to.be.a('string'); version = res.body.info.version; }) .end(done);