Invitation Code Implementation

For my app I’ve connected the Google api and users will sign in using their google account but I want it be invite only so they will need a 10 digit invitation code also, to get through.

For testing I’ve created a database of 10 digit random numbers.

And an input field for the invitation code

But I’m not sure how to tie everything together so that in addition to the google sign in my users will also need an invitation code.

I thought that changing the only when for Signup/login with Google workflow to search for invitation code then a constraint of random number would work but I get an issue of only should be a yes/no but now it’s a list of invitation codes.

Let me know if I’m on the right track or if there’s a better way to implement this. I want my users to only be able to sign in with google with an invitation code.