this is the Sessions table
i have made a login api, this is the in between code of that api, i want to change the device to “mobile”, how can i do this, anyone?
this is the Sessions table
i have made a login api, this is the in between code of that api, i want to change the device to “mobile”, how can i do this, anyone?
use this code
try:
login_manager = frappe.auth.LoginManager()
login_manager.authenticate(user=usr, pwd=pwd)
login_manager.post_login()
frappe.db.sql("""UPDATE `tabSessions` SET device = 'mobile' WHERE sid = %s""", frappe.session.sid)
frappe.db.commit()
except:
data_dict = {
"Login":False,
"message":"Invalid username or password"
}
return data_dict