diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-11-23 12:25:36 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-11-23 12:25:52 +0300 |
commit | 636b038e01c7064c6d1a88359f0370dbefc323e1 (patch) | |
tree | a22bfcec8fda9c806d0c935b92ffed59bbf703b6 /app/models/concerns/token_authenticatable_strategies/base.rb | |
parent | d31a3873f4e25697bb65a00cb9cf7cdd0bdb6a5f (diff) |
Only allow valid options when configuring tokens
Diffstat (limited to 'app/models/concerns/token_authenticatable_strategies/base.rb')
-rw-r--r-- | app/models/concerns/token_authenticatable_strategies/base.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/concerns/token_authenticatable_strategies/base.rb b/app/models/concerns/token_authenticatable_strategies/base.rb index c2c644558c0..23ee34962c7 100644 --- a/app/models/concerns/token_authenticatable_strategies/base.rb +++ b/app/models/concerns/token_authenticatable_strategies/base.rb @@ -48,6 +48,10 @@ module TokenAuthenticatableStrategies end def self.fabricate(instance, field, options) + if options[:digest] && options[:encrypted] + raise ArgumentError, 'Incompatible options set!' + end + if options[:digest] TokenAuthenticatableStrategies::Digest.new(instance, field, options) elsif options[:encrypted] |