Feature request: login!
method
#327
Labels
enhancement
New feature or request
to be implemented in v1
This issue or pull request will be resolved in the v1 rework, but has not yet been completed.
I'd like to suggest adding a
login!
method, that would behave likelogin
except it would raise an exception if the login fails.This is similar to the
save
/save!
methods in Rails.It would be helpful in cases where you want to code the "happy path", and handle exceptions separately. For instance instead of:
you could have:
A few notes:
render json
for the sake of simplicity but view templates would be used insteadSorcery::InvalidCredentials
is just a suggestion, I'm open to ideas for a better nameThe text was updated successfully, but these errors were encountered: