pet-rescue icon indicating copy to clipboard operation
pet-rescue copied to clipboard

Clicking pet when viewing adoption applications as adopter fosterer leads to unauthorized error

Open coalest opened this issue 4 months ago • 2 comments

Reproduction steps:

  1. Log in as an adopter, eg. [email protected]:123456
  2. Go to the Adoption Applicationspage
  3. Click on a pet's name.
  4. See the error message like screenshot below: Screenshot from 2024-10-10 20-27-17

Expected behavior:

In theory I have already put in an application to adopt these pets, so I would expect to be directed to a page with information about that pet (either generic information or information on the application I made).

Actual behavior:

I see an error message flash that says "You are not authorized to perform this action." In the logs, I see a request was sent to GET /alta/adoptable_pets/1 failed the policy check and resulted in a 302 redirect. I believe because this part of the expression returns false as the pet does have a match (the current user).

coalest avatar Oct 10 '24 19:10 coalest