[MOV] website, auth_signup: support auth parameters in request directly in auth_signup module
Let us completely support auth_signup_token and auth_login in request session and parameters in the auth_signup module instead of in various separate places.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import base_config_settings
|
||||
from . import ir_http
|
||||
from . import res_partner
|
||||
from . import res_users
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models
|
||||
from odoo.http import request
|
||||
|
||||
|
||||
class Http(models.AbstractModel):
|
||||
_inherit = 'ir.http'
|
||||
|
||||
@classmethod
|
||||
def _dispatch(cls):
|
||||
# add signup token or login to the session if given
|
||||
if 'auth_signup_token' in request.params:
|
||||
request.session['auth_signup_token'] = request.params['auth_signup_token']
|
||||
if 'auth_login' in request.params:
|
||||
request.session['auth_login'] = request.params['auth_login']
|
||||
|
||||
return super(Http, cls)._dispatch()
|
||||
@@ -71,17 +71,6 @@ class Http(models.AbstractModel):
|
||||
if request.is_frontend and request.routing_iteration == 1:
|
||||
request.website = request.website.with_context(request.context)
|
||||
|
||||
@classmethod
|
||||
def _dispatch(cls):
|
||||
# add signup token or login to the session if given
|
||||
if 'auth_signup_token' in request.params:
|
||||
request.session['auth_signup_token'] = request.params['auth_signup_token']
|
||||
if 'auth_login' in request.params:
|
||||
request.session['auth_login'] = request.params['auth_login']
|
||||
|
||||
resp = super(Http, cls)._dispatch()
|
||||
return resp
|
||||
|
||||
@classmethod
|
||||
def _get_languages(cls):
|
||||
if getattr(request, 'website', False):
|
||||
|
||||
Reference in New Issue
Block a user