fix: set unprocessable entity status on login failure
- Change the render method to include a status of :unprocessable_entity when the email/password combination is invalid. - This change improves the API response for invalid login attempts, allowing clients to better handle errors.
This commit is contained in:
parent
a418c136ae
commit
286ca3419f
@ -14,7 +14,7 @@ class SessionsController < ApplicationController
|
|||||||
redirect_to forwarding_url || user
|
redirect_to forwarding_url || user
|
||||||
else
|
else
|
||||||
flash.now[:danger] = "Invalid email/password combination"
|
flash.now[:danger] = "Invalid email/password combination"
|
||||||
render "new"
|
render "new", status: :unprocessable_entity
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user