2armedlopin
2armedlopin
Explore posts from servers
DTDrizzle Team
Created by 2armedlopin on 5/13/2024 in #help
After this new update I am getting an introspection error schema below "drizzle-kit": "^0.21.1",
Error: There is not enough information to infer relation "public.users.twoFactorConfirmation"
export const usersRelations = relations(users, ({ one }) => ({
twoFactorConfirmation: one(twoFactorConfirmation),
}))
export const usersRelations = relations(users, ({ one }) => ({
twoFactorConfirmation: one(twoFactorConfirmation),
}))
export const twoFactorConfirmation = createTable('twoFactorConfirmation', {
id: text('id')
.primaryKey()
.$defaultFn(() => randomUUID()),
userId: text('userId').references(() => users.id, { onDelete: 'cascade' }),
})
export const twoFactorConfirmation = createTable('twoFactorConfirmation', {
id: text('id')
.primaryKey()
.$defaultFn(() => randomUUID()),
userId: text('userId').references(() => users.id, { onDelete: 'cascade' }),
})
export const users = createTable(
'user',
{
id: text('id')
.primaryKey()
.$defaultFn(() => randomUUID()),
image: text('image'),
name: text('name'),
email: text('email').notNull().unique(),
emailVerified: timestamp('emailVerified', { mode: 'date' }),
password: text('password'),
role: text('role').notNull().default('USER'),
phoneNumber: text('phone_number'),
phoneVerified: timestamp('phone_verified', { mode: 'date' }),
phoneVerificationCode: text('phone_verification_code'),
createdAt: timestamp('created_at')
.default(sql`CURRENT_TIMESTAMP`)
.notNull(),
updatedAt: timestamp('updatedAt'),
isTwoFactorEnabled: boolean('isTwoFactorEnabled').default(false),
stripeCustomerId: text('stripeCustomerId'),
paymentStatus: text('paymentStatus', {
enum: ['paid', 'unpaid', 'no_payment_required'],
}),
},
(example) => ({
nameIndex: index('name_idx').on(example.name),
})
)
export const users = createTable(
'user',
{
id: text('id')
.primaryKey()
.$defaultFn(() => randomUUID()),
image: text('image'),
name: text('name'),
email: text('email').notNull().unique(),
emailVerified: timestamp('emailVerified', { mode: 'date' }),
password: text('password'),
role: text('role').notNull().default('USER'),
phoneNumber: text('phone_number'),
phoneVerified: timestamp('phone_verified', { mode: 'date' }),
phoneVerificationCode: text('phone_verification_code'),
createdAt: timestamp('created_at')
.default(sql`CURRENT_TIMESTAMP`)
.notNull(),
updatedAt: timestamp('updatedAt'),
isTwoFactorEnabled: boolean('isTwoFactorEnabled').default(false),
stripeCustomerId: text('stripeCustomerId'),
paymentStatus: text('paymentStatus', {
enum: ['paid', 'unpaid', 'no_payment_required'],
}),
},
(example) => ({
nameIndex: index('name_idx').on(example.name),
})
)
3 replies
CDCloudflare Developers
Created by 2armedlopin on 12/12/2023 in #workers-help
Cookie not set even though Set-Cookie header is present
Hello folks I have a server containerized and hosted on GCP I have a A record at cloudflare that points to the IP at GCP My frontend is an astro app SSR with cloudflare workers hosted on cloudflare pages I have a cname for my development UI on cloudflare pages that points to .pages.dev url On the frontend I make a post request with a standard html form that makes a request to my server using form data This is a login request. The request succeeds and the proper headers are sent back to set the session id in cookies
Content-Length:
0
Content-Type:
text/html
Date:
Mon, 11 Dec 2023 17:17:21 GMT
Location:
https://development.mydomain.com/
Server:
Google Frontend
Set-Cookie:
session_id=fe492865-959b-4366-9494-4a7e8467e6da; Path=/; Max-Age=86400; HttpOnly
Vary:
Origin,Access-Control-Request-Method
X-Cloud-Trace-Context:
8e6e9a3092a38c09e2c258dba1dba51f;o=1
Content-Length:
0
Content-Type:
text/html
Date:
Mon, 11 Dec 2023 17:17:21 GMT
Location:
https://development.mydomain.com/
Server:
Google Frontend
Set-Cookie:
session_id=fe492865-959b-4366-9494-4a7e8467e6da; Path=/; Max-Age=86400; HttpOnly
Vary:
Origin,Access-Control-Request-Method
X-Cloud-Trace-Context:
8e6e9a3092a38c09e2c258dba1dba51f;o=1
I am having trouble figuring out why the cookie is not being set on the UI . Anyone have any ideas about things I should think about This does not seem to be cors related.
1 replies
CDCloudflare Developers
Created by 2armedlopin on 12/11/2023 in #general-help
Session ID not being set. Frontend is receiving set-cookie header from the server
Hello folks I have a server containerized and hosted on GCP I have a A record at cloudflare that points to the IP at GCP My frontend is an astro app SSR with cloudflare workers hosted on cloudflare pages I have a cname for my development UI on cloudflare pages that points to .pages.dev url On the frontend I make a post request with a standard html form that makes a request to my server using form data This is a login request. The request succeeds and the proper headers are sent back to set the session id in cookies
Content-Length:
0
Content-Type:
text/html
Date:
Mon, 11 Dec 2023 17:17:21 GMT
Location:
https://development.mydomain.com/
Server:
Google Frontend
Set-Cookie:
session_id=fe492865-959b-4366-9494-4a7e8467e6da; Path=/; Max-Age=86400; HttpOnly
Vary:
Origin,Access-Control-Request-Method
X-Cloud-Trace-Context:
8e6e9a3092a38c09e2c258dba1dba51f;o=1
Content-Length:
0
Content-Type:
text/html
Date:
Mon, 11 Dec 2023 17:17:21 GMT
Location:
https://development.mydomain.com/
Server:
Google Frontend
Set-Cookie:
session_id=fe492865-959b-4366-9494-4a7e8467e6da; Path=/; Max-Age=86400; HttpOnly
Vary:
Origin,Access-Control-Request-Method
X-Cloud-Trace-Context:
8e6e9a3092a38c09e2c258dba1dba51f;o=1
I am having trouble figuring out why the cookie is not being set on the UI . Anyone have any ideas about things I should think about This does not seem to be cors related.
2 replies