• [deleted]

troymccann If I clik the 'login' link again, the window pops up trying to load wordpress.site/flarum_auth and returns a 404.

I can also confirm this behaviour. It's been reported to me several times.

    • [deleted]

    • Edited

    troymccann To fix this issue of being locked out of FL, I can go back to WP, log out, log back in, and then FL is happily logged in using the cookie.

    And that's also my workaround...I also have the additional issue of WordPress remaining logged in, and Flarum being logged out.

    [deleted] Ah, my bad. I had read the whole thread, but before I was looking out for this bug. Thanks.

    Looking at the documentation, I'm guessing this part of the process is where the bug is:
    Wordpress returns the remember token directly to Flarum without setting any cookie

    Is there an explanation on why we don't let WP set the Flarum remember cookie on the cookie domain like in process when logging in from WP?

    troymccann e.g. You can only login to Flarum if you're an Editor or Admin on Wordpress

    There is no such feature implemented at this time. You'd have to manually assign admin/editor groups inside Flarum and use the Flarum permissions to restrict access based on those groups. Anyone would still be able to login into Flarum with a Wordpress account, their access would just be limited by permissions.

    troymccann I enter my details and click to login. Nothin happens for about 10 seconds, and then the window loads wp-admin for that user.

    This sounds like a WP plugin might be interfering with the login flow. Could you check if you have any security or login related plugins installed ? If a plugin tries to redirect the user to a specific page after login, it might prevent the Flarum login from working.

    When logging in from Flarum, the cookie isn't used. It's done like that for multiple reasons, but mostly because it's the most secure one.

    troymccann If I clik the 'login' link again, the window pops up trying to load wordpress.site/flarum_auth and returns a 404

    You mean when you are logged into Wordpress but logged out of Flarum, clicking the log in button in Flarum opens that page in the popup ? That's something I will try to fix.

      Thanks @clarkwinkelmann. I've just found the issue this morning. It was one of my plugins that I wasn't aware was doing any redirects on login, and was also unnecessarily redirecting the admin account to wp-admin unconditionally.

      Looking at their code, it seems to be unintentional. They're using a string of if statements to decide where to direct various types of users and various redirects, but seem to have mixed up the necessary order of some statements and have included others that don't need to be handled at all if they had the correct order.

      I've disabled the offending code in that plugin and everything is good now, and I've let them know so they can hopefully clean up their code.

      clarkwinkelmann You mean when you are logged into Wordpress but logged out of Flarum, clicking the log in button in Flarum opens that page in the popup ? That's something I will try to fix.

      That's right, but with the other plugin fixed this isn't an issue anymore. I assume you want it to be if you manually visit wp.server/flarum-auth when already logged in it won't send a new token to the flarum server?

      EDITED

        troymccann thanks for the investigation, glad that issue is solved!

        While rare under normal circumstances, there could still be situations in which you end up logged in inside one of the app and not the other. Apart from app errors during login, the other probable cause is if one of the sessions expires naturally before the other and that the user visits again at that time. So I still want to get this fixed somehow. Ideally if you're connected in Wordpress but not in Flarum, I want to either show the login popup just like you would when logged out of both, or eventually make the popup immediately close and connect Flarum with the user already connected in Wordpress.

        9 days later

        Would this work with Buddypress? Currently I have a custom plugin on my site that I wrote so that the Wordpress comments show up on the user's profile on Buddypress. Would comments written on a wordpress site with this plugin then be incompatible with wordpress?

          Gizmotronn there's no integration at this time. When my plugin is active no comments are saved in the Wordpress database and only Flarum discussions and posts are used.

          You could list a user's posts from Flarum through the Flarum REST API. Or use Flarum profiles as the main user profiles ?

          Thanks @clarkwinkelmann. The only problem for me is that after 4 years of developing with Wordpress & Buddypress, I have grown used to the BP-style profiles (which, unfortunately, Flarum does not yet have - as Flarum is mainly used as a forum, rather than a social network with a forum like Buddypress). The other problem is that I have other requirements for my site that only Buddypress can fulfill. I'll have a look at what you suggested, and thanks for the quick response. As it's not the most important thing it can obviously wait a while.

          Flarum extension version 1.3.4 - May 6, 2020

          • Flarum beta 13 compatibility
          • Remove unused code for features not yet implemented

          You can update the Flarum extension via Bazaar or Composer.
          Requires version 1.2 or greater of the Wordpress plugin.

          Is there a way to make this plugin work with custom post types on WP? I am migrating forum posts to Flarum but there will continue to be blog posts and additional videos in their own post type that have traditionally received comments. It would be great if these could be integrated into the forum as well.

            • [deleted]

            • Edited

            @clarkwinkelmann do you know if fof/prettymail is compatible with your WordPress extension ? I've been speaking to @Kyrne and @Ralkage concerning my issues with the body of the email message being missing, but neither of them can identify any issue, or reproduce it at their end ?

            Thanks

              • [deleted]

              datitisev aha !! Thanks - that could be the issue....

              • [deleted]

              datitisev t's not currently compatible. There's an issue in flarum/core about the issue (flarum/core#2105). I think that's related.

              Actually, this extension doesn't work on posts that are created even directly in Flarum or using the API... ?

                • [deleted]

                datitisev I have, but they are in fact linked 🙂

                Is there a new issue or is it still related to the previously reported issues ? Unfortunately, without a change in Flarum Core, I don't see any easy solution.

                The issue relates to converting a post into text and there's the one reported in FriendsOfFlarum/follow-tags7 and the other linked by David flarum/core2105

                As previously discussed, I have not been able to find any issue with pretty-mail. The identified issue relates to FoF Follow-tags and FoF Subscribed, but ultimately it's a missing feature in core that creates limitations here.

                A workaround I could implement is to have the first post be an actual post and not an event post, but this means loosing the custom styling, the custom link, and the excerpt "read more" button. This also prevents using features I plan to add in the future, including showing the Wordpress post author.