Merge pull request #5330 from overleaf/ab-analytics-middleware-passport-id
Fix passport user id reference in analytics ID middleware GitOrigin-RevId: 7d237a6f358b5632c672aafd6e1e72ab53d8650f
This commit is contained in:
@@ -198,7 +198,7 @@ describe('AnalyticsManager', function () {
|
||||
|
||||
it('sets session.analyticsId with a logged in user in session having an analyticsId', async function () {
|
||||
this.req.session.user = {
|
||||
userId: this.userId,
|
||||
_id: this.userId,
|
||||
analyticsId: this.analyticsId,
|
||||
}
|
||||
await this.AnalyticsManager.analyticsIdMiddleware(
|
||||
@@ -211,7 +211,7 @@ describe('AnalyticsManager', function () {
|
||||
|
||||
it('sets session.analyticsId with a legacy user session without an analyticsId', async function () {
|
||||
this.req.session.user = {
|
||||
userId: this.userId,
|
||||
_id: this.userId,
|
||||
analyticsId: undefined,
|
||||
}
|
||||
await this.AnalyticsManager.analyticsIdMiddleware(
|
||||
@@ -224,7 +224,7 @@ describe('AnalyticsManager', function () {
|
||||
|
||||
it('updates session.analyticsId with a legacy user session without an analyticsId if different', async function () {
|
||||
this.req.session.user = {
|
||||
userId: this.userId,
|
||||
_id: this.userId,
|
||||
analyticsId: undefined,
|
||||
}
|
||||
this.req.analyticsId = 'foo'
|
||||
@@ -238,7 +238,7 @@ describe('AnalyticsManager', function () {
|
||||
|
||||
it('does not update session.analyticsId with a legacy user session without an analyticsId if same', async function () {
|
||||
this.req.session.user = {
|
||||
userId: this.userId,
|
||||
_id: this.userId,
|
||||
analyticsId: undefined,
|
||||
}
|
||||
this.req.analyticsId = this.userId
|
||||
|
||||
Reference in New Issue
Block a user