# Backend function calling permission error even if the user is logged in

**URL:** <https://forum.wixstudio.com/t/backend-function-calling-permission-error-even-if-the-user-is-logged-in/69723>\
**Category:** Ask the community\
**Tags:** wix-members-backend, wix-members-frontend, wix-members-area, code\
**Created:** [March 19, 2025, 5:44pm UTC](https://forum.wixstudio.com/t/backend-function-calling-permission-error-even-if-the-user-is-logged-in/69723 "2025-03-19T17:44:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mauriziomassaro](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@mauriziomassaro](https://forum.wixstudio.com/u/mauriziomassaro)\
**Post date:** [March 19, 2025, 5:44pm UTC](https://forum.wixstudio.com/t/backend-function-calling-permission-error-even-if-the-user-is-logged-in/69723/1 "2025-03-19T17:44:54Z")

</div>

I am having some problems with the login procedure of my website. I do a standard login and I import a backend function with permissions set to SiteMembers:  
import { authentication } from ‘wix-members-frontend’;  
import { checkoutFreePlan } from ‘backend/planOrder.web’  
…

let authenticationResult = await authentication.login(email, password)  
console.log(authenticationResult)  
let isLoggedIn = await authentication.loggedIn();  
if (isLoggedIn){  
let freePlanCheck = await checkoutFreePlan()  
console.log(freePlanCheck)  
}

When I call the checkoutFreePlan function I got the following error:  
Error: Error: Unable to handle the request. Contact the site administrator or view site monitoring logs for more information.  
In the logs of the webiste I got:  
NotAuthorizedError: Error: Unable to handle the request. Contact the site administrator or view site monitoring logs for more information

How is that possible as the isLoggedIn function works, I console logged the user details. Why the backend is not seeing the user as logged in?

If I change the permission to Anyone to my backend function everything seems to work.

Any idea or suggestion?

Thank you so much

---

<div class="post-metadata">

**Author:** ![onemoretime](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/onemoretime/32/104023_2.png) [@onemoretime](https://forum.wixstudio.com/u/onemoretime)\
**Post date:** [March 20, 2025, 3:53pm UTC](https://forum.wixstudio.com/t/backend-function-calling-permission-error-even-if-the-user-is-logged-in/69723/2 "2025-03-20T15:53:19Z")

</div>

Hi, @mauriziomassaro !!

Hello 🙂, does `checkoutFreePlan` use any Wix APIs? 🤔 It’s possible that the API itself requires some kind of permission setting.
