@@ -45,8 +45,9 @@ import { sanitizeProfile } from "@cocalc/server/auth/sso/sanitize-profile";
4545import { callback2 as cb2 } from "@cocalc/util/async-utils" ;
4646import { is_valid_email_address } from "@cocalc/util/misc" ;
4747import { HELP_EMAIL } from "@cocalc/util/theme" ;
48- import { emailBelongsToDomain , getEmailDomain } from "./ check-required-sso" ;
48+ import { emailBelongsToDomain } from "@cocalc/util/auth- check-required-sso" ;
4949import { SSO_API_KEY_COOKIE_NAME } from "./consts" ;
50+ import { getEmailDomain } from "@cocalc/util/auth-check-required-sso" ;
5051
5152const logger = getLogger ( "server:auth:sso:passport-login" ) ;
5253
@@ -240,7 +241,7 @@ export class PassportLogin {
240241 const exclusiveDomains = strategy . info ?. exclusive_domains ?? [ ] ;
241242 if ( ! isEmpty ( exclusiveDomains ) ) {
242243 for ( const email of opts . emails ?? [ ] ) {
243- const emailDomain = getEmailDomain ( email . toLocaleLowerCase ( ) ) ;
244+ const emailDomain = getEmailDomain ( email . toLowerCase ( ) ) ;
244245 for ( const ssoDomain of exclusiveDomains ) {
245246 if ( emailBelongsToDomain ( emailDomain , ssoDomain ) ) {
246247 return true ;
@@ -253,7 +254,7 @@ export class PassportLogin {
253254
254255 // similar to the above, for a specific email address
255256 private checkEmailExclusiveSSO ( email_address : string ) : boolean {
256- const emailDomain = getEmailDomain ( email_address . toLocaleLowerCase ( ) ) ;
257+ const emailDomain = getEmailDomain ( email_address . toLowerCase ( ) ) ;
257258 for ( const strategyName in this . opts . passports ) {
258259 const strategy = this . opts . passports [ strategyName ] ;
259260 for ( const ssoDomain of strategy . info ?. exclusive_domains ?? [ ] ) {
@@ -510,7 +511,7 @@ export class PassportLogin {
510511 }
511512
512513 // We update the email address, if it does not belong to another account.
513-
514+
514515 if ( is_valid_email_address ( locals . email_address ) ) {
515516 upd . email_address = locals . email_address ;
516517 }
0 commit comments