fix(realtime): fetch user_type if not available in session data (#31865)

This commit is contained in:
Nikhil Kothari 2025-03-24 10:14:48 +05:30 committed by GitHub
parent e9aa5e21b9
commit 86425acfc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(),
}