diff --git a/backend/src/app/config.clj b/backend/src/app/config.clj index ca549187898..b0769fe70cd 100644 --- a/backend/src/app/config.clj +++ b/backend/src/app/config.clj @@ -180,7 +180,7 @@ [:oidc-roles-attr {:optional true} :string] [:oidc-email-attr {:optional true} :string] [:oidc-name-attr {:optional true} :string] - [:smb-name {:optional false} :string] + [:default-email-domain {:optional true} :string] [:ldap-attrs-email {:optional true} :string] [:ldap-attrs-fullname {:optional true} :string] diff --git a/backend/src/app/http/auth_request.clj b/backend/src/app/http/auth_request.clj index 4a36f7ebd8d..b0057519077 100644 --- a/backend/src/app/http/auth_request.clj +++ b/backend/src/app/http/auth_request.clj @@ -40,15 +40,15 @@ (defn- resolve-email "If the claim is already a valid email, return it as-is. - Otherwise treat it as a bare username and append @.com." + Otherwise treat it as a bare username and append @." [email-claim] (if (valid-email? email-claim) email-claim - (let [domain (cf/get :smb-name)] - (l/wrn :hint "x-auth-request: email claim is not a valid address, constructing from smb-name" + (let [domain (or (cf/get :default-email-domain) "askii.ai")] + (l/wrn :hint "x-auth-request: email claim is not a valid address, constructing from default-email-domain" :claim email-claim :domain domain) - (str (first (str/split email-claim #"@")) "@" domain ".com")))) + (str (first (str/split email-claim #"@")) "@" domain)))) (defn- get-or-register-profile "Looks up a profile by email. If not found and the diff --git a/backend/test/backend_tests/helpers.clj b/backend/test/backend_tests/helpers.clj index a88f21aa8cd..4be2cedf8d6 100644 --- a/backend/test/backend_tests/helpers.clj +++ b/backend/test/backend_tests/helpers.clj @@ -65,7 +65,7 @@ :redis-uri "redis://redis/1" :auto-file-snapshot-every 1 :file-data-backend "db" - :smb-name "testcorp"}) + :default-email-domain "askii.ai"}) (def config (cf/read-config :prefix "penpot-test"