Disable new signs up using FacebookAuthProvider

Hi there,
Anyone knows if it is possible to disable new signup while allowing the existing users to login in FacebookAuthProvider?

So for eg. If as a user I’ve been using FB to login, I would still be allowed to login but this will be disabled for new users.

Seems like it would be something like using CustomValidationFilter as in the docs here? Check if the user exists already exists?

Thanks!
Kebin

Yeah you would use CustomValidationFilter where returning a non null response like a HttpResult.Redirect() will invalidate the authentication and remove the users session.

You can determine if they’re an existing user with:

var existingUser = ctx.AuthRepository.GetUserAuth(ctx.Session, ctx.AuthTokens);