Skip to content

Commit

Permalink
Fix updateKeyPassword() returning Promise<Key> (#986)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazuumiN authored Aug 20, 2023
1 parent a93d390 commit a5767bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .auri/$zvzn8ngu.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
package: "lucia" # package name
type: "minor" # "major", "minor", "patch"
---

Fixed `updateKeyPassword()` to return a `Promise<Key>`
4 changes: 2 additions & 2 deletions packages/lucia/src/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -642,14 +642,14 @@ export class Auth<_Configuration extends Configuration = any> {
providerId: string,
providerUserId: string,
password: string | null
): Promise<void> => {
): Promise<Key> => {
const keyId = createKeyId(providerId, providerUserId);
const hashedPassword =
password === null ? null : await this.passwordHash.generate(password);
await this.adapter.updateKey(keyId, {
hashed_password: hashedPassword
});
await this.getKey(providerId, providerUserId);
return await this.getKey(providerId, providerUserId);
};
}
type MaybePromise<T> = T | Promise<T>;
Expand Down

0 comments on commit a5767bd

Please sign in to comment.