Making WordPress.org

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#5102 closed defect (bug) (fixed)

Clicking 'Favourite' w/ expired cookie takes to page with json error

Reported by: garrett-eclipse's profile garrett-eclipse Owned by: dd32's profile dd32
Milestone: Priority: normal
Component: Plugin Directory Keywords:
Cc:

Description

If you're on a plugin page with an expired cookie and you click favourite it will take you to a white page with a json error;
{"code":"rest_cookie_invalid_nonce","message":"Cookie nonce is invalid","data":{"status":403}}
URL - https://wordpress.org/plugins/wp-json/plugins/v1/plugin/plugin-name/favorite?_wpnonce=d3dc9a15fb&favorite=1

It would be nice if this could be caught and provided as a nicer message on the page instead of taking over the entire page.

Change History (3)

#1 @dd32
5 years ago

  • Owner set to dd32
  • Resolution set to fixed
  • Status changed from new to closed

In 9666:

Plugin Directory: When the Favourite/Unfavourite button is clicked after the rest api nonce has expired (or their login session has expired) redirect back to the plugin page.

Fixes #5102.

#2 @dd32
5 years ago

[9666] isn't perfect, it simply ignores the error and redirects back to the plugin page, with no messaging as to what happened.

That is good enough to me, it gets rid of the bad UX and I can't imagine many people get hit by this bug given the number of people who actually use the favouriting system.

#3 @garrett-eclipse
5 years ago

Thanks @dd32 appreciated

Note: See TracTickets for help on using tickets.