Conversation
f163526 to
af626ac
Compare
Add confirmation query as url params in email
af626ac to
3002a6f
Compare
mcelicalderon
left a comment
There was a problem hiding this comment.
Looks good, left some comments
| /*.sqlite3 | ||
| /spec/dummy/db/development.sqlite3 | ||
| /spec/dummy/db/test.sqlite3 | ||
| /graphql_devise-0.1.0.gem |
There was a problem hiding this comment.
Tus will change with every version use *.gem instead
| argument :config_name, String, required: false | ||
|
|
||
| def resolve(email:, **attrs) | ||
| redirect_url = attrs.delete(:confirm_success_url) |
There was a problem hiding this comment.
I would add kargs that are required directly in the resolve params so you don't have to do something like this
| module Mutations | ||
| class SignUp < Base | ||
| argument :email, String, required: true | ||
| argument :name, String, required: false |
There was a problem hiding this comment.
Name is an attribute only on the dummy app, we need a way to configure that, or at least remove this one for now. You can use a custom mutation in the dummy app that extends from this one
| resource.respond_to?(:confirmed_at) | ||
| end | ||
|
|
||
| def active_for_authentication?(resource) |
There was a problem hiding this comment.
This one seems redundant when you can call that directly on resource
| end | ||
|
|
||
| # NOTE: Devise controller method, find a way to re use it |
There was a problem hiding this comment.
You could put it on the base mutation if some other mutation uses it
| @@ -0,0 +1,19 @@ | |||
| module GraphqlDevise | |||
| module MailerHelper | |||
| extend ActiveSupport::Concern | |||
| module MailerHelper | ||
| extend ActiveSupport::Concern | ||
|
|
||
| protected |
There was a problem hiding this comment.
I think helpers are usually just public
| default_mutations = { | ||
| login: GraphqlDevise::Mutations::Login, | ||
| logout: GraphqlDevise::Mutations::Logout, | ||
| signUp: GraphqlDevise::Mutations::SignUp, |
| end | ||
|
|
||
| GraphqlDevise::Types::MutationType.field("#{mapping_name}_#{action}", mutation: used_mutation) | ||
| GraphqlDevise::Types::MutationType.field("#{mapping_name}_#{action.to_s.underscore}", mutation: used_mutation) |
There was a problem hiding this comment.
Use snake case everywhere until it is required otherwise
There was a problem hiding this comment.
Naming here uses snake case, note "#{mapping_name}_
There was a problem hiding this comment.
Yes, calling underscore here is not necessary as you changed line 22
| GraphqlDevise::Types::MutationType.field("#{mapping_name}_#{action.to_s.underscore}", mutation: used_mutation) | ||
| end | ||
|
|
||
| Devise.mailer.send(:add_template_helper, GraphqlDevise::MailerHelper) |
There was a problem hiding this comment.
There might be an engine way not to need this, but is the method not public?
There was a problem hiding this comment.
Let me take a look, but it is private doc
f013fc2 to
284f501
Compare
284f501 to
aa9c806
Compare
Uh oh!
There was an error while loading. Please reload this page.