Cowardly Dog Courage
Explore posts from serversBABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user
🫰🏿
38 replies
BABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user
@Ping thank you bro
38 replies
BABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user
38 replies
BABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user
i think adding a small note in the migration guide might be useful
38 replies
BABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user
i only truncate the user table but never thought about the account table
38 replies
BABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user
i was following the migration guide from Next auth
38 replies
BABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user
i think i fixed the issue i need to truncate the account table also
38 replies
BABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user
i just add it now to check not using that feature
38 replies
BABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user

38 replies
BABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user
@Ping this is all the log
38 replies
BABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user
2025-04-17T16:17:31.624Z INFO [Better Auth]: [Drizzle Adapter] #5 [1/3] findOne: {
model: 'user',
where: [
{
operator: 'eq',
connector: 'AND',
field: 'id',
value: 'oYiFGWTA2ArOVRchO623424v1Vmd'
}
],
select: undefined
}
2025-04-17T16:17:31.978Z INFO [Better Auth]: [Drizzle Adapter] #5 [2/3] findOne (DB Result): { model: 'user', data: null }
2025-04-17T16:17:31.979Z INFO [Better Auth]: [Drizzle Adapter] #5 [3/3] findOne (Parsed Result): { model: 'user', data: null }
2025-04-17T16:17:31.979Z INFO [Better Auth]: [Drizzle Adapter] #6 [1/4] create (Unsafe Input): {
model: 'user',
data: {
createdAt: 2025-04-17T16:17:31.979Z,
updatedAt: 2025-04-17T16:17:31.979Z,
name: 'name',
email: '[email protected]',
image: 'https://lh3.googleusercontent.com/a/hsjgadhghjagdhjgaghjdgah65234vanvd=s96-c',
emailVerified: true
}
}
2025-04-17T16:17:31.980Z INFO [Better Auth]: [Drizzle Adapter] #6 [2/4] create (Parsed Input): {
model: 'user',
data: {
name: 'name',
email: '[email protected]',
emailVerified: true,
image: 'https://lh3.googleusercontent.com/a/hsjgadhghjagdhjgaghjdgah65234vanvd=s96-c',
createdAt: 2025-04-17T16:17:31.979Z,
updatedAt: 2025-04-17T16:17:31.979Z,
id: 'MnYt0C7PBsaCiiM4gtR6C0MuylU9tXdr'
}
}
2025-04-17T16:17:32.286Z ERROR [Better Auth]: LibsqlError: SQLITE_CONSTRAINT: SQLite error: UNIQUE constraint failed: user.email
2025-04-17T16:17:32.286Z ERROR [Better Auth]: unable_to_create_user
GET /api/auth/callback/google?state=SC8Hklz_pY9MikcaIJr-Jh0TgnIYGzid&code=4%2F0Ab_5qlmhA6dAwSsdfhhjsgdfjgsvUwc82Xh4akuiIshdbfhsfkSfpb_lI0r2AQ&scope=email+profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.emai
2025-04-17T16:17:31.624Z INFO [Better Auth]: [Drizzle Adapter] #5 [1/3] findOne: {
model: 'user',
where: [
{
operator: 'eq',
connector: 'AND',
field: 'id',
value: 'oYiFGWTA2ArOVRchO623424v1Vmd'
}
],
select: undefined
}
2025-04-17T16:17:31.978Z INFO [Better Auth]: [Drizzle Adapter] #5 [2/3] findOne (DB Result): { model: 'user', data: null }
2025-04-17T16:17:31.979Z INFO [Better Auth]: [Drizzle Adapter] #5 [3/3] findOne (Parsed Result): { model: 'user', data: null }
2025-04-17T16:17:31.979Z INFO [Better Auth]: [Drizzle Adapter] #6 [1/4] create (Unsafe Input): {
model: 'user',
data: {
createdAt: 2025-04-17T16:17:31.979Z,
updatedAt: 2025-04-17T16:17:31.979Z,
name: 'name',
email: '[email protected]',
image: 'https://lh3.googleusercontent.com/a/hsjgadhghjagdhjgaghjdgah65234vanvd=s96-c',
emailVerified: true
}
}
2025-04-17T16:17:31.980Z INFO [Better Auth]: [Drizzle Adapter] #6 [2/4] create (Parsed Input): {
model: 'user',
data: {
name: 'name',
email: '[email protected]',
emailVerified: true,
image: 'https://lh3.googleusercontent.com/a/hsjgadhghjagdhjgaghjdgah65234vanvd=s96-c',
createdAt: 2025-04-17T16:17:31.979Z,
updatedAt: 2025-04-17T16:17:31.979Z,
id: 'MnYt0C7PBsaCiiM4gtR6C0MuylU9tXdr'
}
}
2025-04-17T16:17:32.286Z ERROR [Better Auth]: LibsqlError: SQLITE_CONSTRAINT: SQLite error: UNIQUE constraint failed: user.email
2025-04-17T16:17:32.286Z ERROR [Better Auth]: unable_to_create_user
GET /api/auth/callback/google?state=SC8Hklz_pY9MikcaIJr-Jh0TgnIYGzid&code=4%2F0Ab_5qlmhA6dAwSsdfhhjsgdfjgsvUwc82Xh4akuiIshdbfhsfkSfpb_lI0r2AQ&scope=email+profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.emai
38 replies
BABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user
2025-04-17T16:17:31.624Z INFO [Better Auth]: [Drizzle Adapter] #4 [3/3] findOne (Parsed Result): {
model: 'account',
data: {
accountId: '11512gjgigugug8766hkjhj',
providerId: 'google',
userId: 'oYiFGWTA2ArOVRchO6bYc58sFbcv1Vmd',
accessToken: 'ya29.a0AZYkNhfuyguy888mn33h-EH-s2AoOuzJbrC35bC8dzkFfG_YfrGi1CjvG3fMesvEvbKHcOVHDrhKJzMrvsfCCndIYe6SW04SGxaPS6qjye8D59eHsdopThn7pOdOhBHZfgghv86798hk34wcg-0bhbhISFQHGX2MiaNyFVbJHNNhX6LcuxAerJw0177',
refreshToken: null,
idToken: 'eyJhbGciOiJSUzI1NiIsImtpZCI6ImM3ZTA0NDY1NjQ5ZmZhNjA2NTU3NjUwYzdlNjVmMGE4N2FlMDBmZTgiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJhenAiOiIzMjk2ODg3Mzc4ODctNjdnOTg1ODV0cWg2c2xscjNydnEwY2szdnRzNDRqM20uYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJhdWQiOiIzMjk2ODg3Mzc4ODctNjdnOTg1ODV0cWg2c2xscjNydnEwY2szdnRzNDRqM20uYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJzdWIiOiIxMTUxMjM4OTc3NDQ2NTk4Nzk1MzYiLCJlbWFpbCI6InNyZWVzZW5udUBnbWFpbC5jb20iLCJlbWFpbF92ZXJpZmllZCI6ZfX2FETExJYzyugyuffufgigi;h;hZW5fbmFtZSI6IlNyZWUiLCJmYW1pbHlfbmFtZSI6IlNyaWRoYXIiLCJpYXQiOjE3NDQ1NjY3MDEsImV4cCI6MTc0NDU3MDMwMX0.XyKHAOIXVphoR33I76fSV9qVW87lOKqeqSo7IJWTVVJE91gWf_7X3yGoxTXfdd-Hd4m1_Xe33y52NPTIVt6N_pEmCXJduIfGntsS2kq2Tte0k3jPo-Y5JAENYJC3yOxN2uI-0OByryVEvRpe-Ny4iERwbwanOVj5unKbpV6ugzaYov2yjN0yMs28AfWvlCifAB4U2z0CPmBnlvjbnT8yPNYNT9hRAmUzmaN7ekMzYgw2TtuSjojoij3w6yEBz-nMVFA',
accessTokenExpiresAt: 2025-04-13T18:51:37.000Z,
refreshTokenExpiresAt: null,
scope: 'https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/userinfo.profile,openid',
password: null,
createdAt: 2025-04-13T17:51:43.000Z,
updatedAt: 2025-04-13T17:51:43.000Z,
id: 'caa8pYq4C5F9d2yfchqXW9vzIAD2y5ZI'
}
}
2025-04-17T16:17:31.624Z INFO [Better Auth]: [Drizzle Adapter] #4 [3/3] findOne (Parsed Result): {
model: 'account',
data: {
accountId: '11512gjgigugug8766hkjhj',
providerId: 'google',
userId: 'oYiFGWTA2ArOVRchO6bYc58sFbcv1Vmd',
accessToken: 'ya29.a0AZYkNhfuyguy888mn33h-EH-s2AoOuzJbrC35bC8dzkFfG_YfrGi1CjvG3fMesvEvbKHcOVHDrhKJzMrvsfCCndIYe6SW04SGxaPS6qjye8D59eHsdopThn7pOdOhBHZfgghv86798hk34wcg-0bhbhISFQHGX2MiaNyFVbJHNNhX6LcuxAerJw0177',
refreshToken: null,
idToken: 'eyJhbGciOiJSUzI1NiIsImtpZCI6ImM3ZTA0NDY1NjQ5ZmZhNjA2NTU3NjUwYzdlNjVmMGE4N2FlMDBmZTgiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJhenAiOiIzMjk2ODg3Mzc4ODctNjdnOTg1ODV0cWg2c2xscjNydnEwY2szdnRzNDRqM20uYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJhdWQiOiIzMjk2ODg3Mzc4ODctNjdnOTg1ODV0cWg2c2xscjNydnEwY2szdnRzNDRqM20uYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJzdWIiOiIxMTUxMjM4OTc3NDQ2NTk4Nzk1MzYiLCJlbWFpbCI6InNyZWVzZW5udUBnbWFpbC5jb20iLCJlbWFpbF92ZXJpZmllZCI6ZfX2FETExJYzyugyuffufgigi;h;hZW5fbmFtZSI6IlNyZWUiLCJmYW1pbHlfbmFtZSI6IlNyaWRoYXIiLCJpYXQiOjE3NDQ1NjY3MDEsImV4cCI6MTc0NDU3MDMwMX0.XyKHAOIXVphoR33I76fSV9qVW87lOKqeqSo7IJWTVVJE91gWf_7X3yGoxTXfdd-Hd4m1_Xe33y52NPTIVt6N_pEmCXJduIfGntsS2kq2Tte0k3jPo-Y5JAENYJC3yOxN2uI-0OByryVEvRpe-Ny4iERwbwanOVj5unKbpV6ugzaYov2yjN0yMs28AfWvlCifAB4U2z0CPmBnlvjbnT8yPNYNT9hRAmUzmaN7ekMzYgw2TtuSjojoij3w6yEBz-nMVFA',
accessTokenExpiresAt: 2025-04-13T18:51:37.000Z,
refreshTokenExpiresAt: null,
scope: 'https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/userinfo.profile,openid',
password: null,
createdAt: 2025-04-13T17:51:43.000Z,
updatedAt: 2025-04-13T17:51:43.000Z,
id: 'caa8pYq4C5F9d2yfchqXW9vzIAD2y5ZI'
}
}
38 replies
BABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user
2025-04-17T16:17:31.623Z INFO [Better Auth]: [Drizzle Adapter] #4 [2/3] findOne (DB Result): {
model: 'account',
data: {
id: 'caa8pYq4C5F9d2yfchqXW9vzIAD2y5ZI',
accountId: '11512389774465sdfdf',
providerId: 'google',
userId: 'oYiFGWTA2ArOVRchO6bYc58sFbcv1Vmd',
accessToken: 'ya29.a0AZYkNhfuyguy888mn33h-EH-s2AoOuzJbrC35bC8dzkFfG_YfrGi1CjvG3fMesvEvbKHcOVHDrhKJzMrvsfCCndIYe6SW04SGxaPS6qjye8D59eHsdopThn7pOdOhBHZfgghv86798hk34wcg-0bhbhISFQHGX2MiaNyFVbJHNNhX6LcuxAerJw0177',
refreshToken: null,
idToken: 'eyJhbGciOiJSUzI1NiIsImtpZCI6ImM3ZTA0NDY1NjQ5ZmZhNjA2NTU3NjUwYzdlNjVmMGE4N2FlMDBmZTgiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJhenAiOiIzMjk2ODg3Mzc4ODctNjdnOTg1ODV0cWg2c2xscjNydnEwY2szdnRzNDRqM20uYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJhdWQiOiIzMjk2ODg3Mzc4ODctNjdnOTg1ODV0cWg2c2xscjNydnEwY2szdnRzNDRqM20uYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJzdWIiOiIxMTUxMjM4OTc3NDQ2NTk4Nzk1MzYiLCJlbWFpbCI6InNyZWVzZW5udUBnbWFpbC5jb20iLCJlbWFpbF92ZXJpZmllZCI6ZfX2FETExJYzyugyuffufgigi;h;hZW5fbmFtZSI6IlNyZWUiLCJmYW1pbHlfbmFtZSI6IlNyaWRoYXIiLCJpYXQiOjE3NDQ1NjY3MDEsImV4cCI6MTc0NDU3MDMwMX0.XyKHAOIXVphoR33I76fSV9qVW87lOKqeqSo7IJWTVVJE91gWf_7X3yGoxTXfdd-Hd4m1_Xe33y52NPTIVt6N_pEmCXJduIfGntsS2kq2Tte0k3jPo-Y5JAENYJC3yOxN2uI-0OByryVEvRpe-Ny4iERwbwanOVj5unKbpV6ugzaYov2yjN0yMs28AfWvlCifAB4U2z0CPmBnlvjbnT8yPNYNT9hRAmUzmaN7ekMzYgw2TtuSjojoij3w6yEBz-nMVFA',
accessTokenExpiresAt: 2025-04-13T18:51:37.000Z,
refreshTokenExpiresAt: null,
scope: 'https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/userinfo.profile,openid',
password: null,
createdAt: 2025-04-13T17:51:43.000Z,
updatedAt: 2025-04-13T17:51:43.000Z
}
}
2025-04-17T16:17:31.623Z INFO [Better Auth]: [Drizzle Adapter] #4 [2/3] findOne (DB Result): {
model: 'account',
data: {
id: 'caa8pYq4C5F9d2yfchqXW9vzIAD2y5ZI',
accountId: '11512389774465sdfdf',
providerId: 'google',
userId: 'oYiFGWTA2ArOVRchO6bYc58sFbcv1Vmd',
accessToken: 'ya29.a0AZYkNhfuyguy888mn33h-EH-s2AoOuzJbrC35bC8dzkFfG_YfrGi1CjvG3fMesvEvbKHcOVHDrhKJzMrvsfCCndIYe6SW04SGxaPS6qjye8D59eHsdopThn7pOdOhBHZfgghv86798hk34wcg-0bhbhISFQHGX2MiaNyFVbJHNNhX6LcuxAerJw0177',
refreshToken: null,
idToken: 'eyJhbGciOiJSUzI1NiIsImtpZCI6ImM3ZTA0NDY1NjQ5ZmZhNjA2NTU3NjUwYzdlNjVmMGE4N2FlMDBmZTgiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2FjY291bnRzLmdvb2dsZS5jb20iLCJhenAiOiIzMjk2ODg3Mzc4ODctNjdnOTg1ODV0cWg2c2xscjNydnEwY2szdnRzNDRqM20uYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJhdWQiOiIzMjk2ODg3Mzc4ODctNjdnOTg1ODV0cWg2c2xscjNydnEwY2szdnRzNDRqM20uYXBwcy5nb29nbGV1c2VyY29udGVudC5jb20iLCJzdWIiOiIxMTUxMjM4OTc3NDQ2NTk4Nzk1MzYiLCJlbWFpbCI6InNyZWVzZW5udUBnbWFpbC5jb20iLCJlbWFpbF92ZXJpZmllZCI6ZfX2FETExJYzyugyuffufgigi;h;hZW5fbmFtZSI6IlNyZWUiLCJmYW1pbHlfbmFtZSI6IlNyaWRoYXIiLCJpYXQiOjE3NDQ1NjY3MDEsImV4cCI6MTc0NDU3MDMwMX0.XyKHAOIXVphoR33I76fSV9qVW87lOKqeqSo7IJWTVVJE91gWf_7X3yGoxTXfdd-Hd4m1_Xe33y52NPTIVt6N_pEmCXJduIfGntsS2kq2Tte0k3jPo-Y5JAENYJC3yOxN2uI-0OByryVEvRpe-Ny4iERwbwanOVj5unKbpV6ugzaYov2yjN0yMs28AfWvlCifAB4U2z0CPmBnlvjbnT8yPNYNT9hRAmUzmaN7ekMzYgw2TtuSjojoij3w6yEBz-nMVFA',
accessTokenExpiresAt: 2025-04-13T18:51:37.000Z,
refreshTokenExpiresAt: null,
scope: 'https://www.googleapis.com/auth/userinfo.email,https://www.googleapis.com/auth/userinfo.profile,openid',
password: null,
createdAt: 2025-04-13T17:51:43.000Z,
updatedAt: 2025-04-13T17:51:43.000Z
}
}
38 replies
BABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user
2025-04-17T16:17:30.501Z INFO [Better Auth]: [Drizzle Adapter] #2 [1/2] deleteMany (DeleteMany): {
model: 'verification',
where: [
{
operator: 'lt',
connector: 'AND',
field: 'expiresAt',
value: 2025-04-17T16:17:30.501Z
}
]
}
2025-04-17T16:17:30.723Z INFO [Better Auth]: [Drizzle Adapter] #2 [2/2] deleteMany (DB Result): {
model: 'verification',
data: ResultSetImpl {
columns: [],
columnTypes: [],
rows: [],
rowsAffected: 0,
lastInsertRowid: undefined
}
}
2025-04-17T16:17:30.724Z INFO [Better Auth]: [Drizzle Adapter] #3 [1/2] delete: {
model: 'verification',
where: [
{
operator: 'eq',
connector: 'AND',
field: 'id',
value: 'hzQOM2J98JhzdLBFrtXwg9naLbOA7nte'
}
]
}
2025-04-17T16:17:30.976Z INFO [Better Auth]: [Drizzle Adapter] #3 [2/2] delete (DB Result): { model: 'verification' }
2025-04-17T16:17:31.356Z INFO [Better Auth]: [Drizzle Adapter] #4 [1/3] findOne: {
model: 'account',
where: [
{
operator: 'eq',
connector: 'AND',
field: 'accountId',
value: '115121233897745677267536'
},
{
operator: 'eq',
connector: 'AND',
field: 'providerId',
value: 'google'
}
],
select: undefined
}
2025-04-17T16:17:30.501Z INFO [Better Auth]: [Drizzle Adapter] #2 [1/2] deleteMany (DeleteMany): {
model: 'verification',
where: [
{
operator: 'lt',
connector: 'AND',
field: 'expiresAt',
value: 2025-04-17T16:17:30.501Z
}
]
}
2025-04-17T16:17:30.723Z INFO [Better Auth]: [Drizzle Adapter] #2 [2/2] deleteMany (DB Result): {
model: 'verification',
data: ResultSetImpl {
columns: [],
columnTypes: [],
rows: [],
rowsAffected: 0,
lastInsertRowid: undefined
}
}
2025-04-17T16:17:30.724Z INFO [Better Auth]: [Drizzle Adapter] #3 [1/2] delete: {
model: 'verification',
where: [
{
operator: 'eq',
connector: 'AND',
field: 'id',
value: 'hzQOM2J98JhzdLBFrtXwg9naLbOA7nte'
}
]
}
2025-04-17T16:17:30.976Z INFO [Better Auth]: [Drizzle Adapter] #3 [2/2] delete (DB Result): { model: 'verification' }
2025-04-17T16:17:31.356Z INFO [Better Auth]: [Drizzle Adapter] #4 [1/3] findOne: {
model: 'account',
where: [
{
operator: 'eq',
connector: 'AND',
field: 'accountId',
value: '115121233897745677267536'
},
{
operator: 'eq',
connector: 'AND',
field: 'providerId',
value: 'google'
}
],
select: undefined
}
38 replies
BABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user
2025-04-17T16:17:30.273Z INFO [Better Auth]: [Drizzle Adapter] #1 [1/3] findMany: {
model: 'verification',
where: [
{
operator: 'eq',
connector: 'AND',
field: 'identifier',
value: 'SC8Hklz_pY9MikcaIJr-ajdbasdkbad'
}
],
limit: 1,
sortBy: { field: 'createdAt', direction: 'desc' },
offset: undefined
}
2025-04-17T16:17:30.500Z INFO [Better Auth]: [Drizzle Adapter] #1 [2/3] findMany (DB Result): {
model: 'verification',
data: [
{
id: 'hzQOM2J98JhzdLBFrtXwg9naLbOA7nte',
identifier: 'SC8Hklz_pY9MikcaIJr-ajdbasdkbad',
value: '{"callbackURL":"/dashboard","codeVerifier":"ic3SkEQa4CSYxhkuhhhudhfudfugixdErg0OIBrdkmwGL_-PQox3_y9rdqrlGkemqF8Ctw6kTNYueDLnC3DWEl6C_Gandba23bnasdnbQyOXQgAsruag8-9PHNfe0zOF2Z254QyOXQgAsruag8","errorURL":"/sign-in","expiresAt":1744907249078}',
expiresAt: 2025-04-17T16:27:29.000Z,
createdAt: 2025-04-17T16:17:29.000Z,
updatedAt: 2025-04-17T16:17:29.000Z
}
]
}
2025-04-17T16:17:30.501Z INFO [Better Auth]: [Drizzle Adapter] #1 [3/3] findMany (Parsed Result): {
model: 'verification',
data: [
{
identifier: 'SC8Hklz_pY9MikcaIJr-Jh0TgnIYGzid',
value: '{"callbackURL":"/dashboard","codeVerifier":"ic3SkEQa4CSYxhkuhhhudhfudfugixdErg0OIBrdkmwGL_-PQox3_y9rdqrlGkemqF8Ctw6kTNYueDLnC3DWEl6C_Gandba23bnasdnbQyOXQgAsruag8-9PHNfe0zOF2Z254QyOXQgAsruag8","errorURL":"/sign-in","expiresAt":1744907249078}',
expiresAt: 2025-04-17T16:27:29.000Z,
createdAt: 2025-04-17T16:17:29.000Z,
updatedAt: 2025-04-17T16:17:29.000Z,
id: 'hzQOM2J98JhzdLBFrtXwg9naLbOA7nte'
}
]
}
2025-04-17T16:17:30.273Z INFO [Better Auth]: [Drizzle Adapter] #1 [1/3] findMany: {
model: 'verification',
where: [
{
operator: 'eq',
connector: 'AND',
field: 'identifier',
value: 'SC8Hklz_pY9MikcaIJr-ajdbasdkbad'
}
],
limit: 1,
sortBy: { field: 'createdAt', direction: 'desc' },
offset: undefined
}
2025-04-17T16:17:30.500Z INFO [Better Auth]: [Drizzle Adapter] #1 [2/3] findMany (DB Result): {
model: 'verification',
data: [
{
id: 'hzQOM2J98JhzdLBFrtXwg9naLbOA7nte',
identifier: 'SC8Hklz_pY9MikcaIJr-ajdbasdkbad',
value: '{"callbackURL":"/dashboard","codeVerifier":"ic3SkEQa4CSYxhkuhhhudhfudfugixdErg0OIBrdkmwGL_-PQox3_y9rdqrlGkemqF8Ctw6kTNYueDLnC3DWEl6C_Gandba23bnasdnbQyOXQgAsruag8-9PHNfe0zOF2Z254QyOXQgAsruag8","errorURL":"/sign-in","expiresAt":1744907249078}',
expiresAt: 2025-04-17T16:27:29.000Z,
createdAt: 2025-04-17T16:17:29.000Z,
updatedAt: 2025-04-17T16:17:29.000Z
}
]
}
2025-04-17T16:17:30.501Z INFO [Better Auth]: [Drizzle Adapter] #1 [3/3] findMany (Parsed Result): {
model: 'verification',
data: [
{
identifier: 'SC8Hklz_pY9MikcaIJr-Jh0TgnIYGzid',
value: '{"callbackURL":"/dashboard","codeVerifier":"ic3SkEQa4CSYxhkuhhhudhfudfugixdErg0OIBrdkmwGL_-PQox3_y9rdqrlGkemqF8Ctw6kTNYueDLnC3DWEl6C_Gandba23bnasdnbQyOXQgAsruag8-9PHNfe0zOF2Z254QyOXQgAsruag8","errorURL":"/sign-in","expiresAt":1744907249078}',
expiresAt: 2025-04-17T16:27:29.000Z,
createdAt: 2025-04-17T16:17:29.000Z,
updatedAt: 2025-04-17T16:17:29.000Z,
id: 'hzQOM2J98JhzdLBFrtXwg9naLbOA7nte'
}
]
}
38 replies
BABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user
2025-04-17T16:17:29.510Z INFO [Better Auth]: [Drizzle Adapter] #0 [3/4] create (DB Result): {
model: 'verification',
res: {
id: 'hzQOM2J98JhzdLBFrtXwg9naLbOA7nte',
identifier: 'SC8Hklz_pY9MikcaIJr-ajdbasdkbad',
value: '{"callbackURL":"/dashboard","codeVerifier":"ic3SkEQa4CSYxhkuhhhudhfudfugixdErg0OIBrdkmwGL_-PQox3_y9rdqrlGkemqF8Ctw6kTNYueDLnC3DWEl6C_Gandba23bnasdnbQyOXQgAsruag8","errorURL":"/sign-in","expiresAt":1744907249078}',
expiresAt: 2025-04-17T16:27:29.000Z,
createdAt: 2025-04-17T16:17:29.000Z,
updatedAt: 2025-04-17T16:17:29.000Z
}
}
2025-04-17T16:17:29.511Z INFO [Better Auth]: [Drizzle Adapter] #0 [4/4] create (Parsed Result): {
model: 'verification',
data: {
identifier: 'SC8Hklz_pY9MikcaIJr-ajdbasdkbad',
value: '{"callbackURL":"/dashboard","codeVerifier":"ic3SkEQa4CSYxhkuhhhudhfudfugixdErg0OIBrdkmwGL_-PQox3_y9rdqrlGkemqF8Ctw6kTNYueDLnC3DWEl6C_Gandba23bnasdnbQyOXQgAsruag8","errorURL":"/sign-in","expiresAt":1744907249078}',
expiresAt: 2025-04-17T16:27:29.000Z,
createdAt: 2025-04-17T16:17:29.000Z,
updatedAt: 2025-04-17T16:17:29.000Z,
id: 'hzQOM2J98JhzdLBFrtXwg9naLbOA7nte'
}
}
2025-04-17T16:17:29.510Z INFO [Better Auth]: [Drizzle Adapter] #0 [3/4] create (DB Result): {
model: 'verification',
res: {
id: 'hzQOM2J98JhzdLBFrtXwg9naLbOA7nte',
identifier: 'SC8Hklz_pY9MikcaIJr-ajdbasdkbad',
value: '{"callbackURL":"/dashboard","codeVerifier":"ic3SkEQa4CSYxhkuhhhudhfudfugixdErg0OIBrdkmwGL_-PQox3_y9rdqrlGkemqF8Ctw6kTNYueDLnC3DWEl6C_Gandba23bnasdnbQyOXQgAsruag8","errorURL":"/sign-in","expiresAt":1744907249078}',
expiresAt: 2025-04-17T16:27:29.000Z,
createdAt: 2025-04-17T16:17:29.000Z,
updatedAt: 2025-04-17T16:17:29.000Z
}
}
2025-04-17T16:17:29.511Z INFO [Better Auth]: [Drizzle Adapter] #0 [4/4] create (Parsed Result): {
model: 'verification',
data: {
identifier: 'SC8Hklz_pY9MikcaIJr-ajdbasdkbad',
value: '{"callbackURL":"/dashboard","codeVerifier":"ic3SkEQa4CSYxhkuhhhudhfudfugixdErg0OIBrdkmwGL_-PQox3_y9rdqrlGkemqF8Ctw6kTNYueDLnC3DWEl6C_Gandba23bnasdnbQyOXQgAsruag8","errorURL":"/sign-in","expiresAt":1744907249078}',
expiresAt: 2025-04-17T16:27:29.000Z,
createdAt: 2025-04-17T16:17:29.000Z,
updatedAt: 2025-04-17T16:17:29.000Z,
id: 'hzQOM2J98JhzdLBFrtXwg9naLbOA7nte'
}
}
38 replies
BABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user
2025-04-17T16:17:29.078Z INFO [Better Auth]: [Drizzle Adapter] #0 [1/4] create (Unsafe Input): {
model: 'verification',
data: {
createdAt: 2025-04-17T16:17:29.078Z,
updatedAt: 2025-04-17T16:17:29.078Z,
value: '{"callbackURL":"/dashboard","codeVerifier":"ic3SkEQa4CSYxhkuhhhudhfudfugixdErg0OIBrdkmwGL_-PQox3_y9rdqrlGkemqF8Ctw6kTNYueDLnC3DWEl6C_Gandba23bnasdnbQyOXQgAsruag8","errorURL":"/sign-in","expiresAt":1744907249078}',
identifier: 'SC8Hklz_pY9MikcaIJr-ajdbasdkbad',
expiresAt: 2025-04-17T16:27:29.078Z
}
}
2025-04-17T16:17:29.080Z INFO [Better Auth]: [Drizzle Adapter] #0 [2/4] create (Parsed Input): {
model: 'verification',
data: {
identifier: 'SC8Hklz_pY9MikcaIJr-ajdbasdkbad',
value: '{"callbackURL":"/dashboard","codeVerifier":"ic3SkEQa4CSYxhkuhhhudhfudfugixdErg0OIBrdkmwGL_-PQox3_y9rdqrlGkemqF8Ctw6kTNYueDLnC3DWEl6C_Gandba23bnasdnbQyOXQgAsruag8","errorURL":"/sign-in","expiresAt":1744907249078}',
expiresAt: 2025-04-17T16:27:29.078Z,
createdAt: 2025-04-17T16:17:29.078Z,
updatedAt: 2025-04-17T16:17:29.078Z,
id: 'hzQOM2J98JhzdLBFrtXwg9naLbOA7nte'
}
}
2025-04-17T16:17:29.078Z INFO [Better Auth]: [Drizzle Adapter] #0 [1/4] create (Unsafe Input): {
model: 'verification',
data: {
createdAt: 2025-04-17T16:17:29.078Z,
updatedAt: 2025-04-17T16:17:29.078Z,
value: '{"callbackURL":"/dashboard","codeVerifier":"ic3SkEQa4CSYxhkuhhhudhfudfugixdErg0OIBrdkmwGL_-PQox3_y9rdqrlGkemqF8Ctw6kTNYueDLnC3DWEl6C_Gandba23bnasdnbQyOXQgAsruag8","errorURL":"/sign-in","expiresAt":1744907249078}',
identifier: 'SC8Hklz_pY9MikcaIJr-ajdbasdkbad',
expiresAt: 2025-04-17T16:27:29.078Z
}
}
2025-04-17T16:17:29.080Z INFO [Better Auth]: [Drizzle Adapter] #0 [2/4] create (Parsed Input): {
model: 'verification',
data: {
identifier: 'SC8Hklz_pY9MikcaIJr-ajdbasdkbad',
value: '{"callbackURL":"/dashboard","codeVerifier":"ic3SkEQa4CSYxhkuhhhudhfudfugixdErg0OIBrdkmwGL_-PQox3_y9rdqrlGkemqF8Ctw6kTNYueDLnC3DWEl6C_Gandba23bnasdnbQyOXQgAsruag8","errorURL":"/sign-in","expiresAt":1744907249078}',
expiresAt: 2025-04-17T16:27:29.078Z,
createdAt: 2025-04-17T16:17:29.078Z,
updatedAt: 2025-04-17T16:17:29.078Z,
id: 'hzQOM2J98JhzdLBFrtXwg9naLbOA7nte'
}
}
38 replies
BABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user
export const auth = betterAuth({
database: drizzleAdapter(drizzleDb, {
provider: "sqlite",
}),
socialProviders: {
google: {
clientId: process.env.AUTH_GOOGLE_CLIENT_ID! as string,
clientSecret: process.env.AUTH_GOOGLE_CLIENT_SECRET! as string,
},
},
account: {
accountLinking: {
enabled: true,
trustedProviders: ["google"],
},
},
user: {
additionalFields: {
credits: {
type: "number",
default: 350,
},
subscriptionTier: {
type: "string",
default: "free",
},
subscriptionStartDate: {
type: "date",
},
subscriptionEndDate: {
type: "date",
},
lastCreditPurchase: {
type: "date",
},
totalCreditsUsed: {
type: "number",
default: 0,
},
stripeCustomerId: {
type: "string",
},
stripeSubscriptionId: {
type: "string",
},
stripePriceId: {
type: "string",
},
stripeCurrentPeriodEnd: {
type: "date",
},
},
},
});
export const auth = betterAuth({
database: drizzleAdapter(drizzleDb, {
provider: "sqlite",
}),
socialProviders: {
google: {
clientId: process.env.AUTH_GOOGLE_CLIENT_ID! as string,
clientSecret: process.env.AUTH_GOOGLE_CLIENT_SECRET! as string,
},
},
account: {
accountLinking: {
enabled: true,
trustedProviders: ["google"],
},
},
user: {
additionalFields: {
credits: {
type: "number",
default: 350,
},
subscriptionTier: {
type: "string",
default: "free",
},
subscriptionStartDate: {
type: "date",
},
subscriptionEndDate: {
type: "date",
},
lastCreditPurchase: {
type: "date",
},
totalCreditsUsed: {
type: "number",
default: 0,
},
stripeCustomerId: {
type: "string",
},
stripeSubscriptionId: {
type: "string",
},
stripePriceId: {
type: "string",
},
stripeCurrentPeriodEnd: {
type: "date",
},
},
},
});
38 replies
BABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user
@Ping updated
38 replies
BABetter Auth
•Created by Cowardly Dog Courage on 4/16/2025 in #help
Throwing Error when try to login with existing user
Query: select "id", "name", "email", "email_verified", "image", "credits", "subscriptionTier", "subscriptionStartDate", "subscriptionEndDate", "lastCreditPurchase", "totalCreditsUsed", "stripe_customer_id", "stripe_subscription_id", "stripe_price_id", "stripe_current_period_end", "created_at", "updated_at" from "user" where "user"."id" = ? -- params: ["oYiFGWTA2ArOVRchO6bYc58sFbcv1Vmd"]
Query: insert into "user" ("id", "name", "email", "email_verified", "image", "credits", "subscriptionTier", "subscriptionStartDate", "subscriptionEndDate", "lastCreditPurchase", "totalCreditsUsed", "stripe_customer_id", "stripe_subscription_id", "stripe_price_id", "stripe_current_period_end", "created_at", "updated_at") values (?, ?, ?, ?, ?, ?, ?, null, null, null, ?, null, null, null, null, ?, ?) returning "id", "name", "email", "email_verified", "image", "credits", "subscriptionTier", "subscriptionStartDate", "subscriptionEndDate", "lastCreditPurchase", "totalCreditsUsed", "stripe_customer_id", "stripe_subscription_id", "stripe_price_id", "stripe_current_period_end", "created_at", "updated_at" -- params: ["N8970Qc5mmQbK2OKuEme7FXVQ0vvKIwb", "My name", "[email protected]", 1, "https://lh3.googleusercontent.com/a/12345677yKKbb2n665QV=s96-c", 350, "free", 0, 1744827354, 1744827354]
2025-04-16T18:15:54.884Z ERROR [Better Auth]: LibsqlError: SQLITE_CONSTRAINT: SQLite error: UNIQUE constraint failed: user.email
2025-04-16T18:15:54.885Z ERROR [Better Auth]: unable_to_create_user
GET /api/auth/callback/google?state=0Q8x-pDIIX-wDsfg5PaHugfffdhlOVD5T&code=4%2F0Ab_5qlm05xdUOhLBxPT24628PpxCpborBiO6RvvHnI63r7QDkda15iuybhlkGk63gWw&scope=email+profile+openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&authuser=0&prompt=none 302 in 2112ms
Query: select "id", "name", "email", "email_verified", "image", "credits", "subscriptionTier", "subscriptionStartDate", "subscriptionEndDate", "lastCreditPurchase", "totalCreditsUsed", "stripe_customer_id", "stripe_subscription_id", "stripe_price_id", "stripe_current_period_end", "created_at", "updated_at" from "user" where "user"."id" = ? -- params: ["oYiFGWTA2ArOVRchO6bYc58sFbcv1Vmd"]
Query: insert into "user" ("id", "name", "email", "email_verified", "image", "credits", "subscriptionTier", "subscriptionStartDate", "subscriptionEndDate", "lastCreditPurchase", "totalCreditsUsed", "stripe_customer_id", "stripe_subscription_id", "stripe_price_id", "stripe_current_period_end", "created_at", "updated_at") values (?, ?, ?, ?, ?, ?, ?, null, null, null, ?, null, null, null, null, ?, ?) returning "id", "name", "email", "email_verified", "image", "credits", "subscriptionTier", "subscriptionStartDate", "subscriptionEndDate", "lastCreditPurchase", "totalCreditsUsed", "stripe_customer_id", "stripe_subscription_id", "stripe_price_id", "stripe_current_period_end", "created_at", "updated_at" -- params: ["N8970Qc5mmQbK2OKuEme7FXVQ0vvKIwb", "My name", "[email protected]", 1, "https://lh3.googleusercontent.com/a/12345677yKKbb2n665QV=s96-c", 350, "free", 0, 1744827354, 1744827354]
2025-04-16T18:15:54.884Z ERROR [Better Auth]: LibsqlError: SQLITE_CONSTRAINT: SQLite error: UNIQUE constraint failed: user.email
2025-04-16T18:15:54.885Z ERROR [Better Auth]: unable_to_create_user
GET /api/auth/callback/google?state=0Q8x-pDIIX-wDsfg5PaHugfffdhlOVD5T&code=4%2F0Ab_5qlm05xdUOhLBxPT24628PpxCpborBiO6RvvHnI63r7QDkda15iuybhlkGk63gWw&scope=email+profile+openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&authuser=0&prompt=none 302 in 2112ms
38 replies