|
@@ -21,7 +21,7 @@ class Auth(http.Controller):
|
|
# --------------------------------------------------------------------------
|
|
# --------------------------------------------------------------------------
|
|
# Generate JWT token based on username and password field
|
|
# Generate JWT token based on username and password field
|
|
# --------------------------------------------------------------------------
|
|
# --------------------------------------------------------------------------
|
|
- @http.route(['/api/jwt'], type = 'http', auth = 'none', methods = ['POST'])
|
|
|
|
|
|
+ @http.route(['/api/jwt'], type = 'http', auth = 'none', methods = ['POST'], cors = '*')
|
|
def get_jwt(self, **args):
|
|
def get_jwt(self, **args):
|
|
try:
|
|
try:
|
|
user = request.env['res.users'].sudo().search([('login', '=', args['username']), ('active', '=', True)])
|
|
user = request.env['res.users'].sudo().search([('login', '=', args['username']), ('active', '=', True)])
|
|
@@ -45,7 +45,7 @@ class Auth(http.Controller):
|
|
# --------------------------------------------------------------------------
|
|
# --------------------------------------------------------------------------
|
|
# Check JWT token auth
|
|
# Check JWT token auth
|
|
# --------------------------------------------------------------------------
|
|
# --------------------------------------------------------------------------
|
|
- @http.route(['/api/check'], type = 'http', auth = 'none')
|
|
|
|
|
|
+ @http.route(['/api/check'], type = 'http', auth = 'none', cors = '*')
|
|
def check_token(self, **args):
|
|
def check_token(self, **args):
|
|
try:
|
|
try:
|
|
user = request.env['res.users'].sudo().search([('jwt_token', '=', args['token'])])
|
|
user = request.env['res.users'].sudo().search([('jwt_token', '=', args['token'])])
|
|
@@ -72,6 +72,6 @@ class Auth(http.Controller):
|
|
'''
|
|
'''
|
|
class ApiManager(http.Controller):
|
|
class ApiManager(http.Controller):
|
|
|
|
|
|
- @http.route(['/api/customers'], type = 'http', auth = 'none')
|
|
|
|
|
|
+ @http.route(['/api/customers'], type = 'http', auth = 'none', cors = '*')
|
|
def customers(self):
|
|
def customers(self):
|
|
pass
|
|
pass
|