Skip to content

Reset user password using admin account programatically or auth as a user using admin credentials? #5007

Answered by ganigeorgiev
popovidis asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not entirely sure that I understand the last part and how it is related to your question.

In general if you are authenticated as admin you should be able to directly modify the user password without providing the old password:

await pb.admins.authWithPassword("test@example.com", "1234567890")

// change the password of some user by its id
// (if you don't have an id you can send a separate getFirstListItem request)
await pb.collection("users").update("USER_ID", {
    password: "new_pass",
    passwordConfirm: "new_pass",
})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@popovidis
Comment options

Answer selected by popovidis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants