Skip to content
Back

[SOLVED] Question about Accounts

  • 0
  • Accounts
ianmont
29 Mar, 2023, 21:05

Is there any possibility to change another account password via the websdk?

I want to have the possibility to change authenticated user passwords on my admin panel, how can i do that?

TL;DR
Title: [SOLVED] Question about changing passwords and admin privileges in Appwrite Solution: - To restrict certain functions to Admin users or an admin team, you can use the user server SDK with the API token. You can create a function that checks the `APPWRITE_FUNCTION_USER_ID` variable to verify if the user has a specific role or team. - If you want the possibility to change passwords for authenticated users on your admin panel, you can use the user server SDK with the API token. The `usersUpdatePassword` function can be used to change the password of a specific user. Note: Changing another account's
Binyamin
29 Mar, 2023, 21:09

There isn't any direct way as it can be a serious security problem

But, this could be the way to achieve it.

Create a function that will do so using the user server sdk with API token https://appwrite.io/docs/server/users?sdk=nodejs-default#usersUpdatePassword

And when the function is being call you can check the user be examine the APPWRITE_FUNCTION_USER_ID variable https://appwrite.io/docs/functions#functionVariables

And then just check if the user has a specific role or team

VincentGe
29 Mar, 2023, 21:22

Write your Admin panel with the Node SDK

VincentGe
29 Mar, 2023, 21:22

Or

VincentGe
29 Mar, 2023, 21:22

Write Appwrite functions that can ONLY be executed by permissions for Admin users or like, an admin team.

ianmont
30 Mar, 2023, 04:34

Thanks for the different approaches, im going to implement it

joeyouss
24 Apr, 2023, 08:45

Hi @ianmont , if any more help is not required here, can you mark this post as [SOLVED]?

ianmont
24 Apr, 2023, 15:59

sure

ianmont
24 Apr, 2023, 16:00

[SOLVED] Question about Accounts

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