Merge pull request #7094 from overleaf/jpa-redirect-admin-requests

[web] redirect admin users from admin endpoints to the admin domain

GitOrigin-RevId: a4bd7d4f998615efcb46ae9866868af9489c94f5
This commit is contained in:
Jakob Ackermann
2022-03-31 11:37:15 +01:00
committed by Copybot
parent 06bf7347d4
commit c8866bbda0
6 changed files with 182 additions and 55 deletions
@@ -14,6 +14,7 @@ describe('AuthorizationMiddleware', function () {
this.token = 'some-token'
this.AuthenticationController = {}
this.SessionManager = {
getSessionUser: sinon.stub().returns(null),
getLoggedInUserId: sinon.stub().returns(this.userId),
isUserLoggedIn: sinon.stub().returns(true),
}
@@ -42,6 +43,9 @@ describe('AuthorizationMiddleware', function () {
this.AuthenticationController,
'../Authentication/SessionManager': this.SessionManager,
'../TokenAccess/TokenAccessHandler': this.TokenAccessHandler,
'../Helpers/AdminAuthorizationHelper': {
shouldRedirectToAdminDomain: sinon.stub().returns(false),
},
},
})
this.req = {