Skip to content

Commit

Permalink
Merge pull request OCA#329 from OCA/15.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/server-auth (15.0)
  • Loading branch information
bt-admin authored Apr 22, 2023
2 parents b45ea90 + a2011e6 commit 3528941
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ addon | version | maintainers | summary
[auth_ldaps](auth_ldaps/) | 15.0.1.0.0 | | Allows to use LDAP over SSL authentication
[auth_oauth_multi_token](auth_oauth_multi_token/) | 15.0.1.0.0 | | Allow multiple connection with the same OAuth account
[auth_oidc](auth_oidc/) | 15.0.1.0.1 | [![sbidoul](https://github.com/sbidoul.png?size=30px)](https://github.com/sbidoul) | Allow users to login through OpenID Connect Provider
[auth_saml](auth_saml/) | 15.0.1.1.1 | | SAML2 Authentication
[auth_saml](auth_saml/) | 15.0.1.2.0 | | SAML2 Authentication
[auth_session_timeout](auth_session_timeout/) | 15.0.1.0.0 | | This module disable all inactive sessions since a given delay
[auth_signup_partner_company](auth_signup_partner_company/) | 15.0.1.0.0 | | Auth Signup Partner Company
[auth_signup_verify_email](auth_signup_verify_email/) | 15.0.1.0.0 | | Force uninvited users to use a good email for signup
Expand Down
2 changes: 1 addition & 1 deletion auth_saml/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
"name": "SAML2 Authentication",
"version": "15.0.1.1.1",
"version": "15.0.1.2.0",
"category": "Tools",
"author": "XCG Consulting, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/server-auth",
Expand Down
18 changes: 18 additions & 0 deletions auth_saml/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

from odoo.addons.web.controllers.main import (
Home,
Session as WebSession,
ensure_db,
login_and_redirect,
set_cookie_and_redirect,
Expand Down Expand Up @@ -270,3 +271,20 @@ def saml_metadata(self, req, **kw):
),
[("Content-Type", "text/xml")],
)


class Session(WebSession):
@http.route("/web/session/logout", type="http", auth="none")
def logout(self, redirect="/web/login"):
# make sure that when a user logs out, he does not get immediately
# relogged in if autoredirect is enabled, so that they get an
# opportunity to authenticate with a normal password and get access
# e.g. to the admin account.
if "disable_autoredirect" not in redirect:
path, sep, parameters = redirect.partition("?")
if parameters:
parameters += "&disable_autoredirect="
else:
parameters = "disable_autoredirect="
redirect = path + "?" + parameters
return super().logout(redirect=redirect)

0 comments on commit 3528941

Please sign in to comment.