Any way to not require email verification with WP as the SSO Provider?

AI-generated summary

Bypassing Email Verification with WordPress SSO Provider

Zach_Swinehart is looking for a way to bypass email verification in Discourse when using WordPress as the Single Sign-On (SSO) provider. He wants to know if it’s possible to natively disable the requirement for users to confirm their email with Discourse, as users are already verifying their email on the WordPress side.

itsbhanusharma explains that the option might not exist due to spam concerns, but provides a custom function that can override the behavior:

add_filter( 'discourse_email_verification', 'wpdc_custom_disable_email_verification' );
function wpdc_custom_disable_email_verification() {
    return false;
}

Zach_Swinehart thanks itsbhanusharma for the solution and asks about the availability of documentation on actions and filters. itsbhanusharma mentions that the hook has been mentioned in various topics on Meta and is also part of his personal notes.

I have WordPress set up as my SSO provider and am requiring users to verify their email on the WP side before they can create an account. However, they’re nonetheless seeing the activation page after registering on WP and getting redirected to Discourse:

I see a lot in the main SSO post on here about needing to set require_activation = true for a custom implementation, but in the case of the discourse wp plugin SSO, is it not natively possible to bypass the requirement for users to confirm their email with discourse?

I feel like I’m probably missing something simple here, because it seems like this would be implemented into the core functionality.

Thanks,
Zach

A lot of times, it is the case that emails used to create WordPress accounts are not meaningfully verified. Discourse depends a lot on the email address.

There used to be a disclaimer that before overriding the require_activation behavior one should ensure that they’re properly verifying the email one has used to sign up.

my most informed guess here would be that the option doesn’t exist as a checkbox is to prevent spam signups when WordPress is the SSO provider. However, a custom function can easily override this behavior.

add_filter( 'discourse_email_verification', 'wpdc_custom_disable_email_verification' );
function wpdc_custom_disable_email_verification() {
    return false;
}

Wow, thanks so much @itsbhanusharma! This is perfect.

Curious: did you find that hook just digging through the plugin source, or is there a documentation on available actions and filters somewhere? (I didn’t manage to find one, but maybe I missed something)

It has been mentioned multiple times across various topics here on meta. I personally use this for some clients so I had it in my notes as well :slight_smile: