DEV: Case insensitive check on email_verified field (#70)
This commit is contained in:
parent
c7e89b268e
commit
2b6397b6cb
|
@ -24,7 +24,8 @@ class OpenIDConnectAuthenticator < Auth::ManagedAuthenticator
|
|||
true
|
||||
else
|
||||
# Many providers violate the spec, and send this as a string rather than a boolean
|
||||
supplied_verified_boolean == true || supplied_verified_boolean == "true"
|
||||
supplied_verified_boolean == true ||
|
||||
(supplied_verified_boolean.is_a?(String) && supplied_verified_boolean.downcase == "true")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -45,6 +45,12 @@ describe OpenIDConnectAuthenticator do
|
|||
result = authenticator.after_authenticate(hash)
|
||||
expect(result.user).to eq(user)
|
||||
end
|
||||
|
||||
it "matches the user as a titlecase true string" do
|
||||
hash[:extra][:raw_info][:email_verified] = "True"
|
||||
result = authenticator.after_authenticate(hash)
|
||||
expect(result.user).to eq(user)
|
||||
end
|
||||
end
|
||||
|
||||
context "when email_verified is false" do
|
||||
|
|
Loading…
Reference in New Issue