summaryrefslogtreecommitdiff
path: root/app/models/concerns/token_authenticatable_strategies
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-11-23 10:12:09 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2018-11-23 10:12:09 +0100
commitd31a3873f4e25697bb65a00cb9cf7cdd0bdb6a5f (patch)
treed8e9ff93f50b253210c85619e8387099a63f6827 /app/models/concerns/token_authenticatable_strategies
parentd1311119faeedaf163cfba7020dbcab33fb9308f (diff)
downloadgitlab-ce-d31a3873f4e25697bb65a00cb9cf7cdd0bdb6a5f.tar.gz
Improve token strategy fallback and add more specs
Diffstat (limited to 'app/models/concerns/token_authenticatable_strategies')
-rw-r--r--app/models/concerns/token_authenticatable_strategies/base.rb4
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 1435d6a5751..c2c644558c0 100644
--- a/app/models/concerns/token_authenticatable_strategies/base.rb
+++ b/app/models/concerns/token_authenticatable_strategies/base.rb
@@ -40,6 +40,10 @@ module TokenAuthenticatableStrategies
end
def fallback?
+ unless options[:fallback].in?([true, false, nil])
+ raise ArgumentError, 'fallback: needs to be a boolean value!'
+ end
+
options[:fallback] == true
end