Login with Patreon Not Working?

Hi all ,

I’m currently trying to integrate Patreon with my Wordpress website , so the issue is that my Wordpress website is currently running on localhost. I have already installed the patreon-wordpress plugin.

And when I try to login via Patreon , I get the screen -

And after I click “Allow” , nothing happens , the Patreon_Login methods are not getting executed. I think this issue is due to the redirect uri being localhost. Is it so ?

Thanks,
Naveen

It may be due to this:

It seems Patreon API is not returning the var ‘patreon-oauth’ in its return anymore.

In existing Patreon WordPress packages, in patreon_routing.php class, there is a check for it:

	if (array_key_exists( 'patreon-oauth', $wp->query_vars )) {

		if(array_key_exists( 'code', $wp->query_vars )) {

Since patreon-oauth is not being returned, this would fail all the time, leading the login to fail.

But if you combine these conditionals to a single one like the below…

	if (strpos($_SERVER['REQUEST_URI'],'/patreon-authorization/')!==false) {

…then the login would be checked when it lands at redirect url, and it would work. I just check for existence of the particular slug in the request, but you can do the check however you want.

I am using this in my sites and it works so far.

But i reckon there may be new changes in the API soon, so we may need to revisit this code.

2 Likes

Thank you so much . It works now ! :slight_smile:

2 Likes