mirror of
https://gitlab.com/flectra-community/server-ux.git
synced 2024-11-22 22:22:05 +00:00
15 lines
466 B
Python
15 lines
466 B
Python
|
# Copyright 2018 Onestein
|
||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||
|
|
||
|
from flectra import http
|
||
|
from flectra.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')
|