Hey everyone,
While developing in Frappe, I created standalone web pages in the www
folder. I successfully managed to detect if a user is authenticated or not and redirect unauthenticated users to my custom login page. However, I am currently facing an issue: I cannot retrieve the user’s role when they access the page. I need to enforce a constraint where the user must be authenticated and must have a specific role (e.g., Role X) to access the page.
Does anyone have any suggestions or best practices for checking user roles in Frappe when working with standalone web pages? Thanks in advance for your help!
I think it’s in boot, open you page and check frappe.boot in the developer console
or maybe frappe.session
Thank you for answering, in fact i have created a decorater that is triggered when user consulte a specific page it’s like a Middleware in other frameworks