It’s not quite rolling my own auth, but the first time I implemented auth using openauthjs in Cloudflare for SemHub, it took me one week.

The second time, I implemented auth on an AWS stack (the most critical difference being storing the challenge state in DynamoDB instead of Cloudflare KV) and it took me one day. This took me longer than I’d like, and the main blocker was figuring out how to pass cookies from the Cloudfront router to my Lambda (many hoops to jump through).

It’s working now, I am glad. Many more happy coding days to come.