Cédric Krier pushed to branch branch/default at Tryton / Tryton


Commits:
0a4e1372 by Cédric Krier at 2023-06-09T08:17:20+02:00
Do not try to login if Authorization has no username

User application request has an Authorization header so an Authorization
instance is returned but it can not be used for login.

Closes #12312
- - - - -


1 changed file:

- trytond/trytond/protocols/wrappers.py


Changes:

=====================================
trytond/trytond/protocols/wrappers.py
=====================================
@@ -119,7 +119,7 @@
             user_id = security.check(
                 database_name, auth.get('userid'), auth.get('session'),
                 context=context)
-        else:
+        elif auth.username:
             parameters = getattr(auth, 'parameters', auth)
             try:
                 user_id = security.login(
@@ -127,6 +127,8 @@
                     context=context)
             except RateLimitException:
                 abort(HTTPStatus.TOO_MANY_REQUESTS)
+        else:
+            user_id = None
         return user_id
 
     @cached_property



View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/0a4e13728c0a9bb24536cb1033d95ca6749a2b9d

-- 
View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/0a4e13728c0a9bb24536cb1033d95ca6749a2b9d
You're receiving this email because of your account on foss.heptapod.net.


Reply via email to