#Function execution showing guest triggering but I'm logged in?

1 messages · Page 1 of 1 (latest)

slow cloud
#

I tried to run a function from my app while logged in, it then errored out and says User(role: guests) doesn't have permission to do that

steady lance
slow cloud
#

but

#

how?

#

my app brings me to the login/signup screen without a session

#

okay I'll rebuild it

slow cloud
#

yes I'm logged in, I just checked, there's a valid user account

#

is it because it's not being passed to the python script or?

steady lance
slow cloud
#

I set the variables inside the appwrite.json

#

how do I set the execution?

steady lance
slow cloud
#

gotcha

#

so it'd be easier to just pass the object?

slow cloud
#

nvm found it

#

so

#

if I use an API key

#

I'm forced to make it "any"?

steady lance
slow cloud
#

is that a security vulnerability or no because it requires the API key?

steady lance
slow cloud
# steady lance What do you mean?

using an API key, which is the default way in the docs, it has to have guests & users to run it from the server, so I was wrong about any, is that right?

#

yeah

steady lance
slow cloud
#

still getting this error

#

even though guests and users are in the scope

#

I click raw data and it shows me that but

steady lance
slow cloud
#

in the function somewhere

#

oh

#

could it be because

#
client = Client()

  # You can remove services you don't use
  account = Account(client)
  avatars = Avatars(client)
  database = Databases(client)
  functions = Functions(client)
  health = Health(client)
  locale = Locale(client)
  storage = Storage(client)
  teams = Teams(client)
  users = Users(client)
#

I left that in there in case I needed it but

#

that's probably causing it, yes?

#

well it shouldn't in theory cause I'm still authenticating with the API key but

#

it's occuring in execution, also I noticed the await doesn't work

#

maybe because I used asyncx: true

steady lance
slow cloud
#

basically when the user presses a button it's supposed to call this function

#

The function returns data back

steady lance
slow cloud
#

ayy my name is orange now

steady lance
slow cloud
#

all it says in logs/errors is "internal runtime error"

#

the relevant section of my appwrite.json

steady lance