Skip to content

Commit

Permalink
WIP, got the wrong url if undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
mcelicalderon committed Jun 20, 2020
1 parent 6839200 commit a02e44b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions README.md
Expand Up @@ -430,6 +430,25 @@ a clear idea on how to configure the gem on your Rails application.
As mentioned in the introduction there are many configurations that will change how this gem behaves. You can change
this values on the initializer files generated by the installer.

#### Reconfirmable
You can enable reconfirmation of an email whenever it's changed. Simply updating the email
field in your model will send out an email just like when you create a new instance. The email
won't change until the link in the email is clicked.

For this you need to perform a couple of steps:
1. Add the `:confirmable` devise module to your model if you haven't already.
1. Add a new `unconfirmed_email` column to your model.
1. Set `config.send_confirmation_email = true` in your `config/initializers/devise_token_auth.rb`.
1. Set `config.reconfirmable = true` in your `config/initializers/devise.rb`.
1. Set `config.default_confirm_success_url` to a full url where you want users to be redirected
after they click on the confirm link they received via email. This needs to be a full url like
this https://google.com

**Notes:** This was fixed in DTA in version `1.1.4`, so make sure you are using that version
or higher for this to work. Also, the fix introduced in `v1.1.4` breaks with Devise `4.7.2`.
DTA already merged a fix for the incompatibility with Devise `4.7.2` at the time of this
writing, so DTA `> 1.1.4` will be able to work with Devise `>= 4.7.2`.

#### Devise Token Auth Initializer
The generated initializer file `config/initializers/devise_token_auth.rb` has all the available options documented
as comments. You can also use
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/config/initializers/devise_token_auth.rb
Expand Up @@ -42,7 +42,7 @@
Gem::Version.new(DeviseTokenAuth::VERSION) > Gem::Version.new('1.1.4')
config.send_confirmation_email = true
end
config.default_confirm_success_url = 'http://localhost:3000/api/v1/graphql'
config.default_confirm_success_url = 'https://google.com'

# By default we will use callbacks for single omniauth.
# It depends on fields like email, provider and uid.
Expand Down

0 comments on commit a02e44b

Please sign in to comment.