You can get tests that see if you have antibodies for the non-spike regions of SARS-CoV-2. The vaccines only made anti-spike antibodies and people who were infected will have antibodies to other regions of the virus that the vaccine that did not target.
But isn't that also time limited to about 6 weeks, so you would have to have regular tests as well?
You can test specifically for vaccine antibodies, which are limited in diversity.