denise-oneill-inbox-ru commited on
Commit
9bc028a
·
verified ·
1 Parent(s): 8b229b3

Redeploy corrected Rails 8 Blog v1.0.0 from main 01e6be9

Browse files
app/controllers/api/v1/auth/sessions_controller.rb CHANGED
@@ -21,11 +21,11 @@ module Api
21
  end
22
  end
23
 
24
- def respond_to_on_destroy(resource = nil)
25
- if current_user
26
- render json: { message: "Logged out successfully" }, status: :ok
27
- else
28
  render json: { error: "No active session" }, status: :unauthorized
 
 
29
  end
30
  end
31
  end
 
21
  end
22
  end
23
 
24
+ def respond_to_on_destroy(non_navigational_status: :no_content)
25
+ if non_navigational_status == :unauthorized
 
 
26
  render json: { error: "No active session" }, status: :unauthorized
27
+ else
28
+ render json: { message: "Logged out successfully" }, status: :ok
29
  end
30
  end
31
  end