|
|
@ -778,34 +778,6 @@ def new_app_user_validation(usr=None, pwd=None, iid=None, device_data=None): |
|
|
|
except: |
|
|
|
return {'status': 0, 'error': 'Site Error'} |
|
|
|
|
|
|
|
|
|
|
|
@frappe.whitelist(allow_guest=True) |
|
|
|
def data_invalidation(email, device_id, iid=None): |
|
|
|
rate_res = custom_rate_limit(limit=5, seconds=15) |
|
|
|
if rate_res != 1: |
|
|
|
return rate_res |
|
|
|
try: |
|
|
|
|
|
|
|
# User validation |
|
|
|
frappe.set_user("Administrator") |
|
|
|
user_name = frappe.db.sql('''SELECT name FROM {0}.tabUser where email='{1}';'''.format( |
|
|
|
current_db_name, email), as_dict=1) |
|
|
|
|
|
|
|
token_details = [] |
|
|
|
if user_name: |
|
|
|
|
|
|
|
""" New Refresh token update """ |
|
|
|
access_token = generate_access_token(user_name[0]['name']) |
|
|
|
refresh_token = generate_refresh_token() |
|
|
|
token_details = update_tokens_in_doc( |
|
|
|
user_name[0]['name'], access_token, refresh_token) |
|
|
|
|
|
|
|
return {'status': 1, 'data': token_details, 'error': None} |
|
|
|
|
|
|
|
except Exception as e1: |
|
|
|
return {'status': 0, 'data': [], 'error': 'Failed to verify user'} |
|
|
|
|
|
|
|
|
|
|
|
@frappe.whitelist(allow_guest=1) |
|
|
|
def generate_keys(user_name): |
|
|
|
rate_res = custom_rate_limit(limit=5, seconds=15) |
|
|
|