- Apr 7, 2026
- 4 min read
Auth for a One-Person SaaS: PocketBase, Firebase or Code It Yourself
Learned in 2025, revisited now: what I tried, and what I’d pick today.
Every small product I built in 2025 hit the same wall at the same point: who is allowed to see this?
A wedding page for paying couples, a stock app with saved portfolios, an editor with user content.
I ended up trying five ways to do login.
This is what each one taught me.
First, two words people mix up
- Authentication: who is this? Logging in.
- Authorization: what may this person do, right now? Permissions.
A logged-in user isn’t automatically allowed to edit, buy, export or see every record. Products that treat “logged in” as “allowed” are the ones that leak data.
Identity can be centralized; permissions must be checked where the action happens, on the server.
Second, the static site trap
I build a lot on static sites. The tempting trick: add a login SDK, and hide the private section until someone signs in.
It protects nothing. If it was shipped to the browser, assume it can be read. Client-side login is a nicer interface, not security. (I later found exactly this gap in one of my own projects: protected editor pages, unprotected endpoints behind them.) Real protection needs a trusted place (a Cloudflare Worker, a Pages Function, a Firebase Function, a small API) that checks the token or cookie before returning private data.
The five options I tried
| Option | What it is | Good for | Watch out |
|---|---|---|---|
| PocketBase | one binary: database, file storage, auth, admin UI | small SaaS where identity and data live together | your app now owns its auth rules; no foreign keys, so data integrity is on you |
| Firebase Auth | managed identity with email, Google and social sign-in | getting real users signed in fast | admin actions belong in server code, never the browser SDK |
| Logto | open-source identity with OIDC, hosted sign-in, custom domains, webhooks | when login is part of the product experience | more setup: app types, callbacks, DNS, scopes |
| FastAPI, by hand | password hashing, JWTs and route dependencies you write yourself | learning, or full control | every step is yours to get right |
| Forward auth (TinyAuth, Authelia) | a proxy checks the login before the request reaches the app | dashboards and homelab tools with no login of their own | protects whole apps, not per-record permissions |
The same login, two ways
The clearest lesson came from building the same flow in PocketBase and in FastAPI:
| Step | PocketBase | FastAPI |
|---|---|---|
| Send credentials | one SDK call | you build the request |
| Check the password | built in | you hash and compare |
| Issue a token | built in | you sign a JWT |
| Store and send the token | the SDK does it | you store it and add the header |
| Check the token on each request | API rules | a dependency on every protected route |
PocketBase hides five steps behind one call. FastAPI makes you write them all. Neither is wrong. PocketBase is speed; FastAPI is control.
Writing it by hand once is the best way to understand what the convenient option is doing.
What actually went wrong
- Firebase login worked on desktop and failed on phones. The cause was configuration: the authorized domains and redirect setup, especially behind a Cloudflare tunnel. Nothing in my code.
- The SQL habit fought PocketBase. Coming from databases with foreign keys, its “just collections” model felt like an antipattern at first. For small apps it’s fine, if you decide where integrity is enforced.
- Email verification is half the work. Every option needs a working email setup before “sign up” is real.
By the end, I had email and password plus Google sign-in working on desktop and mobile with Firebase, email-code login with Logto, and GitHub sign-in.
What I’d pick now
- A homelab tool or internal dashboard: forward auth in front of the proxy. Don’t add login to an app that doesn’t need to know who you are.
- A small SaaS where users own records: PocketBase. One process, data and identity together, permissions as API rules.
- A product where sign-in must just work, socials included: Firebase Auth for identity, plus a small server function for anything privileged.
- When login becomes a feature (custom domains, SSO, webhooks): Logto.
- Hand-written auth: once, to learn. Not in production.
Takeaways
- Authentication is who; authorization is what. Check the second on the server.
- Hidden in the browser is not protected.
- Pick by who owns the data, not by which SDK looks nicest.
- Most auth bugs are configuration: domains, redirects, email.