Aruthoth
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers
doing an if for each route I need to reach doesn't seem like an elegant way to solve it, but it's what worked in my test
32 replies
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers
I still need to see how this part still works in astro
32 replies
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers
32 replies
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers
I'm using Astro to develop, my middleware is like this for now
32 replies
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers
I did some initial tests to see what the authentication would be like and left it to finish after I finished the main part of the application
32 replies
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers
Well, I haven't "got to that part yet"
32 replies
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers
32 replies
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers
Look, I'm not sure if there's a more elegant way to do this, but I just created a few types
32 replies
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers
I forgot to mention, but I also changed this part
32 replies
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers

32 replies
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers
If I initialize it incorrectly, like the first time I did, I only receive a 500 error.
32 replies
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers
Take a look to see if you're initializing Drizzle incorrectly, just like I did 😅
32 replies
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers
32 replies
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers
I also adjusted the middleware for the session
32 replies
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers
database: drizzleAdapter(c.env.DB, {
-> database: drizzleAdapter(drizzle(c.env.DB), {
32 replies
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers
It was missing the step of creating the client with Drizzle first.
32 replies
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers
32 replies
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers
Revisiting the code more carefully, I realized the database is being initialized incorrectly.
32 replies
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers
At least I managed to create a new user and retrieve their session using Google.
32 replies
BABetter Auth
•Created by Aruthoth on 12/9/2024 in #help
How to set up the database with drizzleAdapter + D1 using Hono on Cloudflare Workers
Except for populating the database, I think I managed to get the authentication flow working.
32 replies