Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions app/helpers/graphql_devise/mailer_helper.rb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@
<p><%= t('.confirm_link_msg') %></p>

<p>
<% if message['schema_url'].present? %>
<%= link_to t('.confirm_account_link'), "#{message['schema_url']}?#{confirmation_query(resource_name: @resource.class.to_s, redirect_url: message['redirect-url'], token: @token).to_query}" %>
<% else %>
<%= link_to t('.confirm_account_link'), "#{CGI.escape(message['redirect-url'].to_s)}?#{{ confirmationToken: @token }.to_query}" %>
<% end %>
<%= link_to t('.confirm_account_link'), "#{message['redirect-url'].to_s}?#{{ confirmationToken: @token }.to_query}" %>
</p>
2 changes: 0 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@
GraphqlDevise::Schema.query(GraphqlDevise::Types::QueryType)

GraphqlDevise.load_schema

Devise.mailer.helper(GraphqlDevise::MailerHelper)
end
end
8 changes: 0 additions & 8 deletions lib/graphql_devise/default_operations/mutations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
require 'graphql_devise/mutations/base'
require 'graphql_devise/mutations/login'
require 'graphql_devise/mutations/logout'
require 'graphql_devise/mutations/resend_confirmation'
require 'graphql_devise/mutations/resend_confirmation_with_token'
require 'graphql_devise/mutations/send_password_reset'
require 'graphql_devise/mutations/send_password_reset_with_token'
require 'graphql_devise/mutations/sign_up'
require 'graphql_devise/mutations/register'
require 'graphql_devise/mutations/update_password'
require 'graphql_devise/mutations/update_password_with_token'
require 'graphql_devise/mutations/confirm_registration_with_token'

Expand All @@ -18,13 +14,9 @@ module DefaultOperations
MUTATIONS = {
login: { klass: GraphqlDevise::Mutations::Login, authenticatable: true },
logout: { klass: GraphqlDevise::Mutations::Logout, authenticatable: true },
sign_up: { klass: GraphqlDevise::Mutations::SignUp, authenticatable: true, deprecation_reason: 'use register instead' },
register: { klass: GraphqlDevise::Mutations::Register, authenticatable: true },
update_password: { klass: GraphqlDevise::Mutations::UpdatePassword, authenticatable: true, deprecation_reason: 'use update_password_with_token instead' },
update_password_with_token: { klass: GraphqlDevise::Mutations::UpdatePasswordWithToken, authenticatable: true },
send_password_reset: { klass: GraphqlDevise::Mutations::SendPasswordReset, authenticatable: false, deprecation_reason: 'use send_password_reset_with_token instead' },
send_password_reset_with_token: { klass: GraphqlDevise::Mutations::SendPasswordResetWithToken, authenticatable: false },
resend_confirmation: { klass: GraphqlDevise::Mutations::ResendConfirmation, authenticatable: false, deprecation_reason: 'use resend_confirmation_with_token instead' },
resend_confirmation_with_token: { klass: GraphqlDevise::Mutations::ResendConfirmationWithToken, authenticatable: false },
confirm_registration_with_token: { klass: GraphqlDevise::Mutations::ConfirmRegistrationWithToken, authenticatable: true }
}.freeze
Expand Down
7 changes: 1 addition & 6 deletions lib/graphql_devise/default_operations/resolvers.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
# frozen_string_literal: true

require 'graphql_devise/resolvers/base'
require 'graphql_devise/resolvers/check_password_token'
require 'graphql_devise/resolvers/confirm_account'

module GraphqlDevise
module DefaultOperations
QUERIES = {
confirm_account: { klass: GraphqlDevise::Resolvers::ConfirmAccount, deprecation_reason: 'use the new confirmation flow as it does not require this query anymore' },
check_password_token: { klass: GraphqlDevise::Resolvers::CheckPasswordToken, deprecation_reason: 'use the new password reset flow as it does not require this query anymore' }
}.freeze
QUERIES = {}.freeze
end
end
31 changes: 3 additions & 28 deletions lib/graphql_devise/model/with_email_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ def initialize(resource, attributes)
end

def call
check_deprecated_attributes

resource_attributes = @attributes.except(:schema_url, :confirmation_success_url, :confirmation_url)
resource_attributes = @attributes.except(:confirmation_url)
return @resource.update(resource_attributes) unless requires_reconfirmation?(resource_attributes)

@resource.assign_attributes(resource_attributes)
Expand All @@ -36,24 +34,8 @@ def call

private

def check_deprecated_attributes
if [@attributes[:schema_url], @attributes[:confirmation_success_url]].any?(&:present?)
ActiveSupport::Deprecation.warn(<<-DEPRECATION.strip_heredoc, caller)
Providing `schema_url` and `confirmation_success_url` to `update_with_email` is deprecated and will be
removed in a future version of this gem.

Now you must only provide `confirmation_url` and the email will contain the new format of the confirmation
url that needs to be used with the new `confirmRegistrationWithToken` on the client application.
DEPRECATION
end
end

def required_reconfirm_attributes?
if @attributes[:schema_url].present?
[@attributes[:confirmation_success_url], DeviseTokenAuth.default_confirm_success_url].any?(&:present?)
else
[@attributes[:confirmation_url], DeviseTokenAuth.default_confirm_success_url].any?(&:present?)
end
[@attributes[:confirmation_url], DeviseTokenAuth.default_confirm_success_url].any?(&:present?)
end

def requires_reconfirmation?(resource_attributes)
Expand All @@ -78,14 +60,7 @@ def email_in_database
end

def confirmation_method_params
if @attributes[:schema_url].present?
{
redirect_url: @attributes[:confirmation_success_url] || DeviseTokenAuth.default_confirm_success_url,
schema_url: @attributes[:schema_url]
}
else
{ redirect_url: @attributes[:confirmation_url] || DeviseTokenAuth.default_confirm_success_url }
end
{ redirect_url: @attributes[:confirmation_url] || DeviseTokenAuth.default_confirm_success_url }
end

def send_confirmation_instructions(saved)
Expand Down
45 changes: 0 additions & 45 deletions lib/graphql_devise/mutations/resend_confirmation.rb

This file was deleted.

38 changes: 0 additions & 38 deletions lib/graphql_devise/mutations/send_password_reset.rb

This file was deleted.

61 changes: 0 additions & 61 deletions lib/graphql_devise/mutations/sign_up.rb

This file was deleted.

46 changes: 0 additions & 46 deletions lib/graphql_devise/mutations/update_password.rb

This file was deleted.

43 changes: 0 additions & 43 deletions lib/graphql_devise/resolvers/check_password_token.rb

This file was deleted.

Loading