Merge pull request #16854 from overleaf/jpa-overleaf-integration-core-tests

[web] enable overleaf-integration module when running SaaS tests

GitOrigin-RevId: 36eda6ef448604a55f8dc8daac5ce29af23b6b0b
This commit is contained in:
Jakob Ackermann
2024-02-05 09:04:05 +00:00
committed by Copybot
parent 640ea9c916
commit 880087945e
17 changed files with 76 additions and 59 deletions
@@ -201,6 +201,7 @@ const AuthenticationController = {
return done(null, null, {
text: req.i18n.translate('to_many_login_requests_2_mins'),
type: 'error',
key: 'to-many-login-requests-2-mins',
status: 429,
})
}
@@ -236,8 +237,8 @@ const AuthenticationController = {
AuthenticationController._recordFailedLogin()
logger.debug({ email }, 'failed log in')
done(null, false, {
text: req.i18n.translate('email_or_password_wrong_try_again'),
type: 'error',
key: 'invalid-password-retry-or-reset',
status: 401,
})
}
@@ -69,8 +69,13 @@ function loginRateLimit(req, res, next) {
} else {
logger.warn({ email }, 'rate limit exceeded')
res.status(429) // Too many requests
res.write('Rate limit reached, please try again later')
res.end()
res.json({
message: {
type: 'error',
text: req.i18n.translate('to_many_login_requests_2_mins'),
key: 'to-many-login-requests-2-mins',
},
})
}
})
}
@@ -33,7 +33,7 @@ module.exports = {
},
}
async function deleteUser(userId, options = {}) {
async function deleteUser(userId, options) {
if (!userId) {
logger.warn('user_id is null when trying to delete user')
throw new Error('no user_id')
@@ -38,7 +38,7 @@ const Features = {
return (
(Boolean(Settings.ldap) && Boolean(Settings.ldap.enable)) ||
(Boolean(Settings.saml) && Boolean(Settings.saml.enable)) ||
Boolean(_.get(Settings, ['overleaf', 'oauth']))
Boolean(Settings.overleaf)
)
},
+4
View File
@@ -11,6 +11,10 @@ block content
form(data-ol-async-form, name="loginForm", action='/login', method="POST")
input(name='_csrf', type='hidden', value=csrfToken)
+formMessages()
+customFormMessage('invalid-password-retry-or-reset', 'danger')
| !{translate('email_or_password_wrong_try_again_or_reset', {}, [{ name: 'a', attrs: { href: '/user/password/reset', 'aria-describedby': 'resetPasswordDescription' } }])}
span.sr-only(id='resetPasswordDescription')
| #{translate('reset_password_link')}
.form-group
input.form-control(
type='email',