-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(oauth): start php session if no session available #3469
Conversation
Interesting! If this solves the empty ID issues it will be amazing! I think it's cleaner if you do just
I've seen some weird behaviors sometimes when you call |
@leogermani – done! Thanks for the tip |
ca27f36 adds the uid logging to the "Nonce verification failed…" message. This way we'll be able to see if nonces fail in that no-uid case. |
@@ -122,7 +122,8 @@ public static function oauth_callback() { | |||
} | |||
|
|||
if ( ! wp_verify_nonce( sanitize_text_field( $_GET[ self::AUTH_CALLBACK ] ), self::AUTH_CALLBACK ) ) { | |||
self::handle_error( __( 'Nonce verification failed.', 'newspack-plugin' ) ); | |||
/* translators: %s is a unique user id */ | |||
sprintf( __( 'Nonce verification failed for id: %s', 'newspack-plugin' ), OAuth::get_unique_id() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you accidentally removed the call to `self::handle_error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Added back in 2b3a8b9
## [5.5.1](v5.5.0...v5.5.1) (2024-10-11) ### Bug Fixes * **oauth:** start php session if no session available ([#3469](#3469)) ([d3e8265](d3e8265))
🎉 This PR is included in version 5.5.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
All Submissions:
Changes proposed in this Pull Request:
In WordPress, the PHP session might not be always started. This change ensures that it always will be.
How to test the changes in this Pull Request:
I was not able to reproduce the conditions under which a session would not be started. A smoke test should be enough.
Other information: