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

@formatCvt according to

Task<IApiRpc> RpcAsync(ISession session, string id, string payload, RetryConfiguration retryConfiguration = null, CancellationToken canceller = default);

we need session , to get session we need authentication with any ways.
I want to check, is user’s email exists? After that, is the email and password correct?
To do that , we should authenticate! (When we don’t know if email or password correct!)
This is so weird that we have email authentication and have no way to check is email or passwords are correct or not.
I have no idea about this.