Handling OAuth Redirect URIs with Generated subdomains for different branches

I have a next.js project using next-auth that I am deploying with Vercel. I am using Google as an OAuth provider and have set it up for localhost and production environments, however Vercel also has their "preview" environments where it assigns a preview build to a subdomain that includes the commit hash. Is it possible to set up some sort of wildcard or something for the redirect URI and allowed origins so auth works in the preview environment as well? Or would it be better just to have a flag that turns it off entirely in this environment?

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum