forked from zauberware/rails-devise-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
redirect to frontend after confirming email adress
- Loading branch information
1 parent
79c83cf
commit 831af15
Showing
5 changed files
with
56 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,40 @@ | ||
require: | ||
- rubocop-performance | ||
- rubocop-rails | ||
- rubocop-rspec | ||
- rubocop-performance | ||
- rubocop-rails | ||
- rubocop-rspec | ||
AllCops: | ||
TargetRubyVersion: 2.6 | ||
NewCops: enable | ||
Exclude: | ||
- "db/**/*" | ||
- "script/**/*" | ||
- "bin/**/*" | ||
- "vendor/**/*" | ||
- "app/helpers/ui_helper*" | ||
- "spec/spec_helper*" | ||
- "spec/rails_helper*" | ||
- Gemfile* | ||
TargetRubyVersion: 2.6 | ||
NewCops: enable | ||
Exclude: | ||
- "db/**/*" | ||
- "script/**/*" | ||
- "bin/**/*" | ||
- "vendor/**/*" | ||
- "app/helpers/ui_helper*" | ||
- "spec/spec_helper*" | ||
- "spec/rails_helper*" | ||
- Gemfile* | ||
Metrics/MethodLength: | ||
Max: 15 | ||
Max: 15 | ||
Metrics/AbcSize: | ||
Max: 25 | ||
Style/MethodCallWithoutArgsParentheses: | ||
Enabled: false | ||
Enabled: false | ||
Metrics/BlockLength: | ||
Exclude: | ||
- "config/**/*" | ||
- "spec/**/*" | ||
- "lib/tasks/**/*" | ||
Exclude: | ||
- "config/**/*" | ||
- "spec/**/*" | ||
- "lib/tasks/**/*" | ||
Layout/LineLength: | ||
Exclude: | ||
- "config/**/*" | ||
Exclude: | ||
- "config/**/*" | ||
RSpec/MultipleExpectations: | ||
Enabled: false | ||
Enabled: false | ||
RSpec/InstanceVariable: | ||
Enabled: false | ||
Enabled: false | ||
RSpec/UnspecifiedException: | ||
Enabled: false | ||
Enabled: false | ||
RSpec/ExampleLength: | ||
Max: 10 | ||
Max: 10 | ||
RSpec/MultipleMemoizedHelpers: | ||
Max: 10 | ||
Max: 10 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
|
||
# Custom confirmations controller | ||
class ConfirmationsController < Devise::ConfirmationsController | ||
# GET /resource/confirmation?confirmation_token=abcdef | ||
def show | ||
self.resource = resource_class.confirm_by_token(params[:confirmation_token]) | ||
yield resource if block_given? | ||
|
||
if resource.errors.empty? | ||
respond_with_navigational(resource) { redirect_to after_confirmation_path_for(resource_name, resource) } | ||
else | ||
redirect_to "http://#{ENV['CLIENT_URL']}?error=#{I18n.t('errors.messages.already_confirmed')}" | ||
end | ||
end | ||
|
||
private | ||
|
||
# redirect user to front end app after confirming the email adress. | ||
def after_confirmation_path_for(_resource_name, _resource) | ||
"http://#{ENV['CLIENT_URL']}?notice=#{I18n.t('devise.confirmations.confirmed')}" | ||
end | ||
end |
This file contains 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
This file contains 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
This file contains 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