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

  1. # Copyright 2018 Onestein
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  3. from odoo import http
  4. from odoo.http import route
  5. class SwitchController(http.Controller):
  6. @route('/easy_switch_user/switch', type='json', auth="none")
  7. def switch(self, login, password):
  8. request = http.request
  9. uid = request.session.authenticate(request.db, login, password)
  10. if uid is False:
  11. raise Exception('Login Failed')