Custom field validation

Hello.

Building a sprinkle to communicate with a Plex server. I got a working function to validate a given token, so how can I now use that to validate a token during registration? A user shouldn’t be able to sign up for the site without a valid token.

The function that validates the token is available at this route:
/plex/tokenvalid/{plextoken}
The custom field is added with lcharette’s UF_UserProfile sprinkle.