Access to RPC functions without authentication

Hi ,
I want to make an RPC function that would check if the email that the user enters exists or not. It happens when the user is not authenticated.

  1. How do I create rpc functions and gain access to the theme without requiring authentication?

  2. How can we access the server before we authenticate?

Thanks in advance.

Any RPC is anonymous by default, it is your decision to check context for userId