mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-10 04:19:32 +00:00
chore: fix test
This commit is contained in:
@@ -17,7 +17,7 @@ services:
|
|||||||
POSTGRES_PASSWORD: password
|
POSTGRES_PASSWORD: password
|
||||||
POSTGRES_DB: better_auth
|
POSTGRES_DB: better_auth
|
||||||
ports:
|
ports:
|
||||||
- "5433:5432"
|
- "5432:5432"
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ describe("anonymous", async () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("link anonymous user account", async () => {
|
it("link anonymous user account", async () => {
|
||||||
const linkedAccount = await client.user.linkAnonymous({
|
const linkedAccount = await client.anonymous.linkAccount({
|
||||||
email: "valid-email@email.com",
|
email: "valid-email@email.com",
|
||||||
password: "valid-password",
|
password: "valid-password",
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ export const anonymous = (options?: AnonymousOptions) => {
|
|||||||
if (email && password) {
|
if (email && password) {
|
||||||
updatedUser = await ctx.context.internalAdapter.updateUser(userId, {
|
updatedUser = await ctx.context.internalAdapter.updateUser(userId, {
|
||||||
email: email,
|
email: email,
|
||||||
|
isAnonymous: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!updatedUser) {
|
if (!updatedUser) {
|
||||||
@@ -98,7 +99,6 @@ export const anonymous = (options?: AnonymousOptions) => {
|
|||||||
providerId: "credential",
|
providerId: "credential",
|
||||||
password: hash,
|
password: hash,
|
||||||
accountId: updatedUser.id,
|
accountId: updatedUser.id,
|
||||||
isAnonymous: false,
|
|
||||||
});
|
});
|
||||||
if (!updateUserAccount) {
|
if (!updateUserAccount) {
|
||||||
return ctx.json(null, {
|
return ctx.json(null, {
|
||||||
|
|||||||
Reference in New Issue
Block a user