Merge pull request #1297 from sharelatex/ja-rate-limit-v2-login

Add rate limit to v2 login end point

GitOrigin-RevId: 81b14387e4a6381f4c0eae17e43af84b2af7fea5
This commit is contained in:
Simon Detheridge 2018-12-19 15:47:38 +00:00 committed by sharelatex
parent b0b87a7b6e
commit d2465f8d6a

View file

@ -115,6 +115,12 @@ define(['base', 'libs/passfield'], function(App) {
'Session error. Please check you have cookies enabled. If the problem persists, try clearing your cache and cookies.',
type: 'error'
}
} else if (status === 429) {
response.message = {
text:
'Too many attempts. Please wait for a while and try again.',
type: 'error'
}
} else {
response.message = {
text:
@ -146,8 +152,8 @@ define(['base', 'libs/passfield'], function(App) {
restrict: 'E',
template: `\
<div class="alert" ng-class="{
'alert-danger': form.response.message.type == 'error',
'alert-success': form.response.message.type != 'error'
'alert-danger': form.response.message.type == 'error',
'alert-success': form.response.message.type != 'error'
}" ng-show="!!form.response.message" ng-bind-html="form.response.message.text">
</div>
<div ng-transclude></div>\