You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
460 B
14 lines
460 B
# Copyright 2018 Onestein
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
|
|
from odoo import http
|
|
from odoo.http import route
|
|
|
|
|
|
class SwitchController(http.Controller):
|
|
@route('/easy_switch_user/switch', type='json', auth="none")
|
|
def switch(self, login, password):
|
|
request = http.request
|
|
uid = request.session.authenticate(request.db, login, password)
|
|
if uid is False:
|
|
raise Exception('Login Failed')
|