Clément NICOLAS

Joined

50 Experience
0 Lessons Completed
0 Questions Solved

Activity

I'm doing a mini-project, for which I'm using two devise models, a user model and a advisor model. When I log in as an advisor, I'm redirected to a 'pages_advisors' page. On this page, there's a link 'create a new appointment type' which should redirect me to new_advisor_appointment_type. Instead, it redirects me to 'user sign in'. In my AppointmentTypes Controller I've put a before_action :authenticate_advisor!. My routes seem correct. When I look at the logs, the message is as follows: Started GET "/advisors/2/appointment_types/new" for 127.0.0.1 at 2024-01-18 00:09:45 +0100
Processing by AppointmentTypesController#new as HTML
Parameters: {"advisor_id"=>"2"}
Completed 401 Unauthorized in 8ms (ActiveRecord: 0.0ms | Allocations: 523). I've searched everywhere, asked chatgpt, can't find a solution... There seems to be a conflict in session management.