mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-23 09:43:56 +00:00
[misc] re-level log: 403 from web goes to WARN and emit 'not authorized'
Users will get redirected to the login page and will see a 'restricted' page after logging in again. See frontend: ConnectionManager.reportConnectionError
This commit is contained in:
parent
d2a2b9d46e
commit
884b340c75
3 changed files with 5 additions and 5 deletions
|
@ -8,6 +8,7 @@ const logger = require('logger-sharelatex')
|
|||
const {
|
||||
CodedError,
|
||||
CorruptedJoinProjectResponseError,
|
||||
NotAuthorizedError,
|
||||
WebApiRequestFailedError
|
||||
} = require('./Errors')
|
||||
|
||||
|
@ -56,6 +57,8 @@ module.exports = {
|
|||
'TooManyRequests'
|
||||
)
|
||||
)
|
||||
} else if (response.statusCode === 403) {
|
||||
callback(new NotAuthorizedError())
|
||||
} else {
|
||||
callback(new WebApiRequestFailedError(response.statusCode))
|
||||
}
|
||||
|
|
|
@ -221,9 +221,7 @@ describe('joinProject', function () {
|
|||
})
|
||||
|
||||
it('should return an error', function () {
|
||||
this.error.message.should.equal(
|
||||
'Something went wrong in real-time service'
|
||||
)
|
||||
this.error.message.should.equal('not authorized')
|
||||
})
|
||||
|
||||
it('should not have joined the project room', function (done) {
|
||||
|
|
|
@ -107,8 +107,7 @@ describe('WebApiManager', function () {
|
|||
this.callback
|
||||
.calledWith(
|
||||
sinon.match({
|
||||
message: 'non-success status code from web',
|
||||
info: { statusCode: 403 }
|
||||
message: 'not authorized'
|
||||
})
|
||||
)
|
||||
.should.equal(true)
|
||||
|
|
Loading…
Reference in a new issue