Skip to content

Commit

Permalink
Add gem for Devise::TokenAuthenticatable and configure it
Browse files Browse the repository at this point in the history
  • Loading branch information
luisramos0 committed Jun 18, 2020
1 parent 888a103 commit 748e223
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Expand Up @@ -49,8 +49,9 @@ gem 'stripe'
# which is needed for Pin Payments (and possibly others).
gem 'activemerchant', '~> 1.78.0'

gem 'devise', '~> 3.5.10'
gem 'devise', '~> 3.5.10' # v4.0.0 needs rails 4.1
gem 'devise-encryptable'
gem 'devise-token_authenticatable', '~> 0.4.10' # v0.5.0 needs devise v4
gem 'jwt', '~> 2.2'
gem 'oauth2', '~> 1.4.4' # Used for Stripe Connect

Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Expand Up @@ -227,6 +227,8 @@ GEM
warden (~> 1.2.3)
devise-encryptable (0.2.0)
devise (>= 2.1.0)
devise-token_authenticatable (0.4.10)
devise (>= 3.5.2, < 4.0.0)
diff-lcs (1.3)
diffy (3.3.0)
docile (1.3.2)
Expand Down Expand Up @@ -731,6 +733,7 @@ DEPENDENCIES
delayed_job_web
devise (~> 3.5.10)
devise-encryptable
devise-token_authenticatable (~> 0.4.10)
dfc_provider!
diffy
eventmachine (>= 1.2.3)
Expand Down
10 changes: 6 additions & 4 deletions config/initializers/devise.rb
Expand Up @@ -90,10 +90,6 @@
# Time interval to unlock the account if :time is enabled as unlock_strategy.
# config.unlock_in = 1.hour

# ==> Configuration for :token_authenticatable
# Defines name of the authentication token params key
config.token_authentication_key = :auth_token

# ==> Scopes configuration
# Turn scoped views on. Before rendering 'sessions/new', it will first check for
# 'users/sessions/new'. It's turned off by default because it's slower if you
Expand Down Expand Up @@ -141,3 +137,9 @@

config.case_insensitive_keys = [:email]
end

Devise::TokenAuthenticatable.setup do |config|
# ==> Configuration for :token_authenticatable
# Defines name of the authentication token params key
config.token_authentication_key = :auth_token
end

0 comments on commit 748e223

Please sign in to comment.