fix(realtime): fetch user_type if not available in session data (#31865)
This commit is contained in:
parent
e9aa5e21b9
commit
86425acfc0
1 changed files with 5 additions and 1 deletions
|
|
@ -121,9 +121,13 @@ def has_permission(doctype: str, name: str) -> bool:
|
|||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def get_user_info():
|
||||
user_type = frappe.session.data.user_type
|
||||
# For requests with Bearer tokens, user_type is not set in the session data
|
||||
if not user_type:
|
||||
user_type = frappe.get_cached_value("User", frappe.session.user, "user_type")
|
||||
return {
|
||||
"user": frappe.session.user,
|
||||
"user_type": frappe.session.data.user_type,
|
||||
"user_type": user_type,
|
||||
"installed_apps": frappe.get_installed_apps(),
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue