I have a Rails API using Devise and a React frontend. I've made a button that when clicked uses axios to make a DELETE request to the /users/sign_out route (is this how I should be logging out with React & Devise?). When I click the button I get a 404 error on the client, and the below error on the server. It seems like the initial request succeeds, but then it attempts to make another DELETE request to the / route and the user isn't signed out properly. Why is this the case?
Started DELETE "/users/sign_out" for ::1 at 2020-08-04 22:59:19 -0700
Processing by Devise::SessionsController#destroy as HTML
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 1], ["LIMIT", 1]]
Can't verify CSRF token authenticity.
Redirected to http://localhost:3000/
Completed 302 Found in 5ms (ActiveRecord: 0.4ms | Allocations: 2069)
Started DELETE "/" for ::1 at 2020-08-04 22:59:19 -0700
ActionController::RoutingError (No route matches [DELETE] "/"):