-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Comments
joshbuker
added
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.
labels
Oct 28, 2022
@joshbuker would you be open to reviewing a PR for this? I can allocate some time to preparing a PR. |
@Spone Yes, if you create a PR, ping me on it, and I'll try to set aside time to work on it. |
3 tasks
@joshbuker please see #332 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: