From 8a4325d84b20d489ec6380ecf15842c13a6a4a75 Mon Sep 17 00:00:00 2001 From: Leo McArdle Date: Fri, 3 Aug 2018 15:10:15 +0100 Subject: [PATCH] add enabled? to authenticator (to prevent warnings) --- lib/mozilla_iam/authenticator.rb | 5 +++++ spec/components/mozilla_iam/authenticator_spec.rb | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/lib/mozilla_iam/authenticator.rb b/lib/mozilla_iam/authenticator.rb index b32cce7..14dbcbf 100644 --- a/lib/mozilla_iam/authenticator.rb +++ b/lib/mozilla_iam/authenticator.rb @@ -1,5 +1,10 @@ module MozillaIAM class Authenticator < Auth::OAuth2Authenticator + + def enabled? + true + end + def after_authenticate(auth_token) begin id_token = auth_token[:credentials][:id_token] diff --git a/spec/components/mozilla_iam/authenticator_spec.rb b/spec/components/mozilla_iam/authenticator_spec.rb index 32d0ff3..dccac0d 100644 --- a/spec/components/mozilla_iam/authenticator_spec.rb +++ b/spec/components/mozilla_iam/authenticator_spec.rb @@ -1,6 +1,13 @@ require_relative '../../iam_helper' describe MozillaIAM::Authenticator do + + context "#enabled?" do + it "returns true" do + expect(described_class.new('auth0', trusted: true).enabled?).to be true + end + end + context '#after_authenticate' do it 'can authenticate a new user' do user = {