Browse Source

Token settings integrate into login

master
venkataakhil 1 year ago
parent
commit
c2e67b69b5
  1. 6
      smart_service/add_ons/doctype/token_settings/token_settings.py
  2. 4
      smart_service/apis/app_user_login.py

6
smart_service/add_ons/doctype/token_settings/token_settings.py

@ -8,4 +8,8 @@ from frappe.model.document import Document
class TokenSettings(Document):
def validate(self):
pass
if self.access_expiry_time <= 0:
frappe.throw("Access exipry time should be valid minutes")
if self.refresh_expiry_time <= 0:
frappe.throw("Refresh exipry time should be valid hours")

4
smart_service/apis/app_user_login.py

@ -954,9 +954,9 @@ def update_tokens_in_doc(user_email, access, refresh):
frappe.db.commit()
user_token_details['access_token'] = access
user_token_details['access_expiry_time'] = access_exp_hours
user_token_details['access_expiry_time'] = access_exp_hours* 60
user_token_details['refresh_token'] = refresh
user_token_details['refresh_expiry_time'] = refresh_exp_hrs
user_token_details['refresh_expiry_time'] = refresh_exp_hrs* 60 * 60
return user_token_details

Loading…
Cancel
Save