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.
Showing
6 changed files
with
104 additions
and
108 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
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,25 @@ | ||
# frozen_string_literal: true | ||
|
||
module Auth | ||
# 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 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# frozen_string_literal: true | ||
|
||
module Auth | ||
# Custom passwords controller | ||
class PasswordsController < Devise::PasswordsController | ||
# GET /resource/password/edit?reset_password_token=abcdef | ||
# redirect user to front end to reset the passwords there | ||
def edit | ||
redirect_to "http://#{ENV['CLIENT_URL']}/users/password/edit?reset_password_token=#{params[:reset_password_token]}" | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
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