@@ -45,8 +45,9 @@ import { sanitizeProfile } from "@cocalc/server/auth/sso/sanitize-profile";
45
45
import { callback2 as cb2 } from "@cocalc/util/async-utils" ;
46
46
import { is_valid_email_address } from "@cocalc/util/misc" ;
47
47
import { HELP_EMAIL } from "@cocalc/util/theme" ;
48
- import { emailBelongsToDomain , getEmailDomain } from "./ check-required-sso" ;
48
+ import { emailBelongsToDomain } from "@cocalc/util/auth- check-required-sso" ;
49
49
import { SSO_API_KEY_COOKIE_NAME } from "./consts" ;
50
+ import { getEmailDomain } from "@cocalc/util/auth-check-required-sso" ;
50
51
51
52
const logger = getLogger ( "server:auth:sso:passport-login" ) ;
52
53
@@ -240,7 +241,7 @@ export class PassportLogin {
240
241
const exclusiveDomains = strategy . info ?. exclusive_domains ?? [ ] ;
241
242
if ( ! isEmpty ( exclusiveDomains ) ) {
242
243
for ( const email of opts . emails ?? [ ] ) {
243
- const emailDomain = getEmailDomain ( email . toLocaleLowerCase ( ) ) ;
244
+ const emailDomain = getEmailDomain ( email . toLowerCase ( ) ) ;
244
245
for ( const ssoDomain of exclusiveDomains ) {
245
246
if ( emailBelongsToDomain ( emailDomain , ssoDomain ) ) {
246
247
return true ;
@@ -253,7 +254,7 @@ export class PassportLogin {
253
254
254
255
// similar to the above, for a specific email address
255
256
private checkEmailExclusiveSSO ( email_address : string ) : boolean {
256
- const emailDomain = getEmailDomain ( email_address . toLocaleLowerCase ( ) ) ;
257
+ const emailDomain = getEmailDomain ( email_address . toLowerCase ( ) ) ;
257
258
for ( const strategyName in this . opts . passports ) {
258
259
const strategy = this . opts . passports [ strategyName ] ;
259
260
for ( const ssoDomain of strategy . info ?. exclusive_domains ?? [ ] ) {
@@ -510,7 +511,7 @@ export class PassportLogin {
510
511
}
511
512
512
513
// We update the email address, if it does not belong to another account.
513
-
514
+
514
515
if ( is_valid_email_address ( locals . email_address ) ) {
515
516
upd . email_address = locals . email_address ;
516
517
}
0 commit comments