Add JSON format support to session destroy for native API clients
This is so that native API clients can get the session record deleted server-side. They still need to take care of clearing any cookies they've set in web views. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
Rosa Gutierrez
parent
ec1b8f2fed
commit
c059e0b216
@@ -117,4 +117,15 @@ class SessionsControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_response :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
test "destroy via JSON" do
|
||||
sign_in_as :kevin
|
||||
|
||||
untenanted do
|
||||
delete session_path(format: :json)
|
||||
|
||||
assert_response :no_content
|
||||
assert_not cookies[:session_token].present?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user