[web] when confirming institution domain, refresh features once per user GitOrigin-RevId: 3855441848cf0b140a6cf0264b887d8eca7db5ad
@@ -63,14 +63,19 @@ function affiliateUserByReversedHostname(user, reversedHostname, callback) {
)
return innerCallback(error)
}
- FeaturesUpdater.refreshFeatures(
- user._id,
- 'affiliate-user-by-reversed-hostname',
- innerCallback
- )
+ innerCallback()
},
- callback
+ err => {
+ if (err) {
+ return callback(err)
+ }
+ FeaturesUpdater.refreshFeatures(
+ user._id,
+ 'affiliate-user-by-reversed-hostname',
+ callback
+ )
@@ -132,6 +132,7 @@ describe('InstitutionsController', function () {
this.refreshFeatures
.calledWith(this.stubbedUser2._id)
.should.equal(true)
+ this.refreshFeatures.should.have.been.calledTwice
return done()
this.next.callsFake(done)