That's the correct way to do it. Age should be something reported by browser/os/hardware. Something similar to User-Agent. I really hope this will end the whole third party age verification farce.
Edit: of course, downvote the comment pointing to Americans having more civil rights. Expect nothing less from the HN techbro cesspool. And yes, this meta commentary infringes the guidelines, and the trust contract is broken at this point. This site does not deserve my energy anymore.