chore: fix test

This commit is contained in:
Bereket Engida
2024-10-21 20:56:10 +03:00
parent 72243d2f78
commit b67d95bbf6
3 changed files with 3 additions and 3 deletions

View File

@@ -17,7 +17,7 @@ services:
POSTGRES_PASSWORD: password
POSTGRES_DB: better_auth
ports:
- "5433:5432"
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data

View File

@@ -35,7 +35,7 @@ describe("anonymous", async () => {
});
it("link anonymous user account", async () => {
const linkedAccount = await client.user.linkAnonymous({
const linkedAccount = await client.anonymous.linkAccount({
email: "valid-email@email.com",
password: "valid-password",
});

View File

@@ -80,6 +80,7 @@ export const anonymous = (options?: AnonymousOptions) => {
if (email && password) {
updatedUser = await ctx.context.internalAdapter.updateUser(userId, {
email: email,
isAnonymous: false,
});
}
if (!updatedUser) {
@@ -98,7 +99,6 @@ export const anonymous = (options?: AnonymousOptions) => {
providerId: "credential",
password: hash,
accountId: updatedUser.id,
isAnonymous: false,
});
if (!updateUserAccount) {
return ctx.json(null, {