You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Login successfully but after that its show error on any request To Reproduce
Steps to reproduce the behavior:
import { FrappeApp} from "frappe-js-sdk";
export const frappe = new FrappeApp("https://localhost...")
on login page
const auth = frappe.auth()
const response = await auth.loginWithUsernamePassword({ username, password})
give me response
{
"message": "Logged In",
"home_page": "/app",
"full_name": "Arslan Jameel"
}
after that when i get Logged In User details its show error below
{
"exc_type": "PermissionError",
"exception": "frappe.exceptions.PermissionError:
You are not permitted to access this resource.Function frappe.auth.get_logged_user is not whitelisted.",
"exc": "["Traceback (most recent call last):\n File \"apps/frappe/frappe/app.py\", line 66, in application\n response = frappe.api.handle()\n File \"apps/frappe/frappe/api.py\", line 55, in handle\n return frappe.handler.handle()\n File \"apps/frappe/frappe/handler.py\", line 38, in handle\n data = execute_cmd(cmd)\n File \"apps/frappe/frappe/handler.py\", line 73, in execute_cmd\n is_whitelisted(method)\n File \"apps/frappe/frappe/init.py\", line 756, in is_whitelisted\n throw(msg, PermissionError, title=\"Method Not Allowed\")\n File \"apps/frappe/frappe/init.py\", line 505, in throw\n msgprint(\n File \"apps/frappe/frappe/init.py\", line 480, in msgprint\n _raise_exception()\n File \"apps/frappe/frappe/init.py\", line 435, in _raise_exception\n raise raise_exception(msg)\nfrappe.exceptions.PermissionError: You are not permitted to access this resource.Function frappe.auth.get_logged_user is not whitelisted.\n"]",
"_server_messages": "["{\"message\": \"You are not permitted to access this resource.Function frappe.auth.get_logged_user is not whitelisted.\", \"title\": \"Method Not Allowed\", \"indicator\": \"red\", \"raise_exception\": 1}"]",
"httpStatus": 403,
"httpStatusText": "",
"message": "There was an error while fetching the logged in user"
}
Environment (please complete the following information):
OS: fedora 38
Browser Firefox
SDK frappe-js-sdk
Nextjs 14
The text was updated successfully, but these errors were encountered:
We got a similar error and created issue #55 , it says get_logged_in_user in frappe auth.py is not a whitelisted function, and it does not allow access to recently logged in user and then return an error for unauthorised
Describe the bug
Login successfully but after that its show error on any request
To Reproduce
Steps to reproduce the behavior:
import { FrappeApp} from "frappe-js-sdk";
export const frappe = new FrappeApp("https://localhost...")
on login page
const auth = frappe.auth()
const response = await auth.loginWithUsernamePassword({ username, password})
give me response
{
"message": "Logged In",
"home_page": "/app",
"full_name": "Arslan Jameel"
}
after that when i get Logged In User details its show error below
{
"exc_type": "PermissionError",
"exception": "frappe.exceptions.PermissionError:
You are not permitted to access this resource.
Function frappe.auth.get_logged_user is not whitelisted."exc": "["Traceback (most recent call last):\n File \"apps/frappe/frappe/app.py\", line 66, in application\n response = frappe.api.handle()\n File \"apps/frappe/frappe/api.py\", line 55, in handle\n return frappe.handler.handle()\n File \"apps/frappe/frappe/handler.py\", line 38, in handle\n data = execute_cmd(cmd)\n File \"apps/frappe/frappe/handler.py\", line 73, in execute_cmd\n is_whitelisted(method)\n File \"apps/frappe/frappe/init.py\", line 756, in is_whitelisted\n throw(msg, PermissionError, title=\"Method Not Allowed\")\n File \"apps/frappe/frappe/init.py\", line 505, in throw\n msgprint(\n File \"apps/frappe/frappe/init.py\", line 480, in msgprint\n _raise_exception()\n File \"apps/frappe/frappe/init.py\", line 435, in _raise_exception\n raise raise_exception(msg)\nfrappe.exceptions.PermissionError:
You are not permitted to access this resource.
Function frappe.auth.get_logged_user is not whitelisted."_server_messages": "["{\"message\": \"
You are not permitted to access this resource.
Function frappe.auth.get_logged_user is not whitelisted."httpStatus": 403,
"httpStatusText": "",
"message": "There was an error while fetching the logged in user"
}
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: