Skip to content
Snippets Groups Projects
Commit 7c99310b authored by Jairo Llopis's avatar Jairo Llopis
Browse files

[FIX] auth_oauth: Override qcontext in the right place


Before this patch, if some module was based on top of `auth_signup`, and `auth_oauth` was also installed in the same database, the only way to get the proper qcontext would be to call `super()` inside `web_auth_signup_qcontext`, which would produce a login, which is most likely not desired because such addon would try to add some logic on top of it that maybe prevents login based on some circumstances.

After this patch, any submodules can work properly without workarounds.

closes odoo/odoo#34690

Signed-off-by: default avatarChristophe Simonis <chs@odoo.com>
parent 3862f636
Branches
Tags
No related merge requests found
......@@ -109,19 +109,10 @@ class OAuthLogin(Home):
return response
@http.route()
def web_auth_signup(self, *args, **kw):
providers = self.list_providers()
response = super(OAuthLogin, self).web_auth_signup(*args, **kw)
response.qcontext.update(providers=providers)
return response
@http.route()
def web_auth_reset_password(self, *args, **kw):
providers = self.list_providers()
response = super(OAuthLogin, self).web_auth_reset_password(*args, **kw)
response.qcontext.update(providers=providers)
return response
def get_auth_signup_qcontext(self):
result = super(OAuthLogin, self).get_auth_signup_qcontext()
result["providers"] = self.list_providers()
return result
class OAuthController(http.Controller):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment