1
1 Comment

I spent a week perfecting Auth so my users don't have to think about it. 🔐

Wrapping up week 3 of building NanoURL! I just finished the part of SaaS development that everyone loves to hate: Authentication.

I decided against using expensive third-party tools like Auth0 or Clerk and rolled a secure, enterprise-grade solution from scratch. It was a rabbit hole, but totally worth it.

Here is what the stack looks like now:

HttpOnly JWTs: No storing tokens in localStorage. Access and Refresh tokens are locked down in secure cookies to prevent XSS attacks.

Google OAuth (The Right Way): Instead of just trusting the frontend, React grabs the Google ID Token and passes it to Spring Boot. Java officially verifies the token audience via the Google API Client, extracts the email, and auto-registers the user behind the scenes.

Anti-Enumeration Resets: Built a secure "Forgot Password" flow using spring-boot-starter-mail. It uses timed, 15-minute expiring UUID tokens saved to the DB, ensuring users can't get locked out if they forget they originally signed up via Google.

Getting the React state perfectly synced with the backend cookies (especially during page refreshes and Google iframe popups) was tricky, but creating a "Single Source of Truth" in my AuthContext finally smoothed it all out.

Click Here : https://nanourl.link/

To the solo-founders out there: Do you still roll your own auth for new projects, or have you completely surrendered to Auth-as-a-Service providers?

posted to Icon for group Building in Public
Building in Public
on April 1, 2026
  1. 1

    Respect for rolling your own auth — that’s a deep rabbit hole most people avoid 😅

    The HttpOnly + backend-verified OAuth setup sounds clean. That React ↔ backend sync pain is very real.

    Personally seeing more people mix — custom for control, external for speed — depends on stage.

    Also, if you’re building early-stage products — $19 puts it in real competition. Tokyo trip + $500 min guaranteed.
    Round just opened: tokyolore.com 🚀

Trending on Indie Hackers
I've been building for months and made $0. Here's the honest psychological reason — and it's not what I expected. User Avatar 178 comments 7 years in agency, 200+ B2B campaigns, now building Outbound Glow User Avatar 83 comments This system tells you what’s working in your startup — every week User Avatar 53 comments 11 Weeks Ago I Had 0 Users. Now VIDI Has Reviewed $10M+ in Contracts - and I’m Opening a Small SAFE Round User Avatar 46 comments The "Book a Demo" Button Was Killing My Pipeline. Here's What I Replaced It With. User Avatar 41 comments I built a desktop app to move files between cloud providers without subscriptions or CLI User Avatar 24 comments