Avoid returning user information on password reset mutation#100
Merged
mcelicalderon merged 2 commits intomasterfrom Jun 12, 2020
Merged
Avoid returning user information on password reset mutation#100mcelicalderon merged 2 commits intomasterfrom
mcelicalderon merged 2 commits intomasterfrom
Conversation
mcelicalderon
requested changes
Jun 12, 2020
Member
mcelicalderon
left a comment
There was a problem hiding this comment.
Looks great! Just minor comments.
|
|
||
| if resource.errors.empty? | ||
| { authenticatable: resource } | ||
| { message: I18n.t('devise.passwords.send_instructions') } |
Member
There was a problem hiding this comment.
Please add the message to our locales file, that was done for all other messages. That way we won't be affected if d ecise changes that message or removes it
| logout: { klass: GraphqlDevise::Mutations::Logout, authenticable: true }, | ||
| sign_up: { klass: GraphqlDevise::Mutations::SignUp, authenticable: true }, | ||
| update_password: { klass: GraphqlDevise::Mutations::UpdatePassword, authenticable: true }, | ||
| send_password_reset: { klass: GraphqlDevise::Mutations::SendPasswordReset, authenticable: true }, |
Member
There was a problem hiding this comment.
This one needs to be authenticatable: false
| sign_up: { klass: GraphqlDevise::Mutations::SignUp, authenticable: true }, | ||
| update_password: { klass: GraphqlDevise::Mutations::UpdatePassword, authenticable: true }, | ||
| send_password_reset: { klass: GraphqlDevise::Mutations::SendPasswordReset, authenticable: true }, | ||
| resend_confirmation: { klass: GraphqlDevise::Mutations::ResendConfirmation, authenticable: true } |
Member
There was a problem hiding this comment.
This one should have a message field too
| update_password: GraphqlDevise::Mutations::UpdatePassword, | ||
| send_password_reset: GraphqlDevise::Mutations::SendPasswordReset, | ||
| resend_confirmation: GraphqlDevise::Mutations::ResendConfirmation | ||
| login: { klass: GraphqlDevise::Mutations::Login, authenticable: true }, |
| it 'sends password reset email' do | ||
| expect { post_request }.to change(ActionMailer::Base.deliveries, :count).by(1) | ||
|
|
||
| expect(json_response.dig(:data, :userSendPasswordReset)).to include( |
Member
There was a problem hiding this comment.
You can't use dig on ruby < 2.3, that is what's breaking the build
|
|
||
| it 'honors devise configuration for case insensitive fields' do | ||
| expect { post_request }.to change(ActionMailer::Base.deliveries, :count).by(1) | ||
| expect(json_response.dig(:data, :userSendPasswordReset)).to include( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #98