Get currently logged in user details

Is it possible to get all details of the currently logged in user from the User doctype ?

I’m trying to make an allocation logic, where the person logged in gets assigned that particular form.

@mr-karan,

You can get the user details using frappe.user or frappe.user_info(email_id) methods on client script

1 Like

Thanks @makarand_b

can you share your code? TIA :slight_smile:

just use user or frappe.session.user if doing so from client side

3 Likes

I have found out a solution for the requirement posted.

There is a table in ERPNext DB named ‘tabSessions’ where in one can find out - user, ipaddress, lastupdate, device, status, and sessiondata - columns. By that one can get to know who are currently logged-in in the system. One can build a custom report and produce the requisite data.

Thanks