Skip to content

Commit 313dc31

Browse files
Tom Blauwendraatfkantelberg
authored andcommitted
[FIX] auth_session_timeout: problem whereby page is refreshed with F5, but /web is a public route, so it does not trigger the session check but it does trigger session save, so the file mtime is updated before the second HTTP call makes the check takes place, and session is not expired
1 parent 241f1b8 commit 313dc31

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

auth_session_timeout/models/ir_http.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ class IrHttp(models.AbstractModel):
1010
@classmethod
1111
def _authenticate(cls, endpoint):
1212
res = super(IrHttp, cls)._authenticate(endpoint=endpoint)
13-
auth_method = endpoint.routing["auth"]
14-
if auth_method == "user" and request and request.env and request.env.user:
13+
if (
14+
request
15+
and request.session
16+
and request.session.uid
17+
and not request.env["res.users"].browse(request.session.uid)._is_public()
18+
):
1519
request.env.user._auth_timeout_check()
1620
return res

0 commit comments

Comments
 (0)