1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-03-03 14:52:36 +02:00
3100: Do not block webmail when we have a valid SSO session r=mergify[bot] a=nextgens

## What type of PR?

bug-fix

## What does this PR do?

Ensure we do not block webmail when we have a valid SSO session

### Related issue(s)
- close  #3094

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [ ] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
This commit is contained in:
bors-mailu[bot] 2023-12-22 08:43:12 +00:00 committed by GitHub
commit df5b48a52d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -37,7 +37,7 @@ def nginx_authentication():
is_valid_user = False
username = response.headers.get('Auth-User', None)
if response.headers.get("Auth-User-Exists") == "True":
if not is_app_token and utils.limiter.should_rate_limit_user(username, client_ip):
if not is_from_webmail and not is_app_token and utils.limiter.should_rate_limit_user(username, client_ip):
# FIXME could be done before handle_authentication()
status, code = nginx.get_status(flask.request.headers['Auth-Protocol'], 'ratelimit')
response = flask.Response()

View File

@ -0,0 +1 @@
Ensure we do not block logins from webmails when there is a valid SSO session