Back

Update authenticated users labels using client or server sdk?

  • 0
  • Users
  • Accounts
  • Web
Dynerus
2 Feb, 2024, 13:48

Hi, the question is pretty clear already. I am trying to add a "premium" label to my user once a certain request has finished. Is it possible to update my users labels throught the client sdk or should I use the server SDK meaning adding an endpoint to update the user on my node server.

TL;DR
Developers are asking if they can update user labels using the client or server SDK. They are concerned about the security of updating labels using the client SDK. The solution is to update labels using the server SDK by creating an endpoint on the node server.
kamal.panara
2 Feb, 2024, 13:49

Hi @Dynerus you can only update labels using only server SDK

kamal.panara
2 Feb, 2024, 13:49

For security, you can’t update using client SDK.

kamal.panara
2 Feb, 2024, 13:50

You can create function that can update labels using server SDK

Dynerus
2 Feb, 2024, 13:50

Alright thanks for the quick answer! seemed pretty weird to me all account fields could be updated by the client except for the labels

Dynerus
2 Feb, 2024, 13:51

Will do, thanks!

kamal.panara
2 Feb, 2024, 13:51

It’s good for example your case, only users with label premium can access certain documents or collections or storage buckets

kamal.panara
2 Feb, 2024, 13:51

If you don’t know, you can use labels for permissions

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more