@@ -57,6 +57,7 @@ import { addUserProfileCallback } from "@cocalc/server/auth/sso/oauth2-user-prof
57
57
import { PassportLogin } from "@cocalc/server/auth/sso/passport-login" ;
58
58
import {
59
59
InitPassport ,
60
+ LoginInfo ,
60
61
PassportManagerOpts ,
61
62
StrategyConf ,
62
63
StrategyInstanceOpts ,
@@ -144,7 +145,7 @@ interface HandleReturnOpts {
144
145
type : PassportTypes ;
145
146
update_on_login : boolean ;
146
147
cookie_ttl_s : number | undefined ;
147
- login_info ;
148
+ login_info : LoginInfo ;
148
149
}
149
150
150
151
export class PassportManager {
@@ -656,9 +657,11 @@ export class PassportManager {
656
657
site_url : this . site_url ,
657
658
} ;
658
659
659
- const dotInstance = this . getDot ( login_info ) ;
660
+ const dotInstance =
661
+ typeof login_info . _sep === "string" ? new dot ( login_info . _sep ) : dot ;
660
662
661
663
for ( const k in login_info ) {
664
+ if ( k === "_sep" ) continue ; // used above, not useful here
662
665
const v = login_info [ k ] ;
663
666
const param : string | string [ ] =
664
667
typeof v == "function"
@@ -690,18 +693,6 @@ export class PassportManager {
690
693
} ;
691
694
}
692
695
693
- private getDot ( login_info ) : DotObject . Dot {
694
- // if login_info contains a key "_delimiter", take it from that object and remove it
695
- // then instantiate dot with that delimiter and use it to pick the values
696
- if ( typeof login_info . _sep === "string" ) {
697
- const sep = login_info . _sep ;
698
- delete login_info . _sep ;
699
- return new dot ( sep ) ;
700
- } else {
701
- return dot ;
702
- }
703
- }
704
-
705
696
// right now, we only set this for OAauth2 (SAML knows what to do on its own)
706
697
// This does not encode any information for now.
707
698
private setState (
0 commit comments