Hi! I recently updated to Flarum 1.0.2 and noticed 2 problems with the plugin.
WP Plugin: v2.2
SSO Flarum v1.10
Fatal error when changing admin account info
When I want to change the admin nickname or profile picture, I get the following error log:
Got error 'PHP message: PHP Fatal error: Uncaught GuzzleHttp\\Exception\\ClientException: Client error: 'PATCH https://forum-website.com/api/users/3' resulted in a '403 Forbidden' response:
{"errors":[{"status":"403","code":"permission_denied"}]}
in /home/[redacted]/webapps/[redacted]/wp-content/plugins/sso-flarum/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
Stack trace:
#0 /home/[redacted]/webapps/[redacted]/wp-content/plugins/sso-flarum/vendor/guzzlehttp/guzzle/src/Middleware.php(69): GuzzleHttp\\Exception\\RequestException::create()
#1 /home/[redacted]/webapps/[redacted]/wp-content/plugins/sso-flarum/vendor/guzzlehttp/promises/src/Promise.php(204): GuzzleHttp\\Middleware::GuzzleHttp\\{closure}()
#2 /home/[redacted]/webapps/[redacted]/wp-content/plugins/sso-flarum/vendor/guzzlehttp/promises/src/Promise.php(153): GuzzleHttp\\Promise\\Promise::callHandler()
#3 /home/[redacted]/webapps/[redacted]/wp-content/plugins/sso-flarum/vendor/guzzlehttp/promises/src/TaskQueue.php(48): GuzzleHttp\\Promise\\Promise::G...', referer: https://WP-website.com/wp-admin/profile.php?wp_http_referer=%2Fwp-admin%2Fusers.php
❓️ Changing the nickname or profile picture of a normal user account does work.
User profile image not updated in Flarum
The user profile picture does not get updated in Flarum, but what does work is by putting the profile avatar code outside the 'if' check.
sso-flarum.php
line 261
$flarum_user->attributes->avatarUrl = get_avatar_url( $user_id, array( 'size' => 100 ) );
/*
if ( get_option( 'flarum_sso_plugin_update_user_avatar' ) ) {
$flarum_user->attributes->avatarUrl = get_avatar_url( $user_id, array( 'size' => 100 ) );
}
*/
Any idea what could cause these issues?
Let me know if you have any questions, thanks!