lib/decidim/suomifi/authentication/authenticator.rb in decidim-suomifi-0.18.1 vs lib/decidim/suomifi/authentication/authenticator.rb in decidim-suomifi-0.19.0

- old
+ new

@@ -11,13 +11,13 @@ @oauth_hash = oauth_hash end def verified_email @verified_email ||= begin - if saml_attributes[:email] + if Decidim::Suomifi.use_suomifi_email && saml_attributes[:email] saml_attributes[:email] - elsif Decidim::Suomifi.auto_email_domain - domain = Decidim::Suomifi.auto_email_domain + else + domain = Decidim::Suomifi.auto_email_domain || organization.host "suomifi-#{person_identifier_digest}@#{domain}" end end end