mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-10 12:27:44 +00:00
Merge branch 'main' into v1.2
This commit is contained in:
@@ -223,6 +223,24 @@ const { data, error } = await authClient.resetPassword({
|
||||
});
|
||||
```
|
||||
|
||||
### Update password
|
||||
|
||||
<Callout type="warn">
|
||||
This only works on server-side, and the following code may change over time.
|
||||
</Callout>
|
||||
|
||||
To set a password, you must hash it first:
|
||||
|
||||
```ts
|
||||
const ctx = await auth.$context;
|
||||
const hash = await ctx.password.hash("your-new-password");
|
||||
```
|
||||
|
||||
Then, to set the password:
|
||||
```ts
|
||||
await ctx.internalAdapter.updatePassword("userId", hash) //(you can also use your orm directly)
|
||||
```
|
||||
|
||||
### Configuration
|
||||
|
||||
**Password**
|
||||
|
||||
Reference in New Issue
Block a user