@@ -224,24 +224,31 @@ export class SignIn extends BaseResource implements SignInResource {
224224 } ) ;
225225 } ;
226226
227- public authenticateWithRedirect = async ( params : AuthenticateWithRedirectParams ) : Promise < void > => {
228- const { strategy, redirectUrl, redirectUrlComplete, identifier } = params || { } ;
229-
230- const { firstFactorVerification } =
231- ( strategy === 'saml' || strategy === 'enterprise_sso' ) && this . id
232- ? await this . prepareFirstFactor ( {
233- strategy,
234- redirectUrl : SignIn . clerk . buildUrlWithAuth ( redirectUrl ) ,
235- actionCompleteRedirectUrl : redirectUrlComplete ,
236- } )
237- : await this . create ( {
238- strategy,
239- identifier,
240- redirectUrl : SignIn . clerk . buildUrlWithAuth ( redirectUrl ) ,
241- actionCompleteRedirectUrl : redirectUrlComplete ,
242- } ) ;
243-
244- const { status, externalVerificationRedirectURL } = firstFactorVerification ;
227+ public authenticateWithRedirect = async ( {
228+ strategy,
229+ redirectUrl,
230+ redirectUrlComplete,
231+ identifier,
232+ continueSignIn = false ,
233+ } : AuthenticateWithRedirectParams ) : Promise < void > => {
234+ if ( this . id && ! continueSignIn ) {
235+ await this . create ( {
236+ strategy,
237+ identifier,
238+ redirectUrl : SignIn . clerk . buildUrlWithAuth ( redirectUrl ) ,
239+ actionCompleteRedirectUrl : redirectUrlComplete ,
240+ } ) ;
241+ }
242+
243+ if ( strategy === 'saml' || strategy === 'enterprise_sso' ) {
244+ await this . prepareFirstFactor ( {
245+ strategy,
246+ redirectUrl : SignIn . clerk . buildUrlWithAuth ( redirectUrl ) ,
247+ actionCompleteRedirectUrl : redirectUrlComplete ,
248+ } ) ;
249+ }
250+
251+ const { status, externalVerificationRedirectURL } = this . firstFactorVerification ;
245252
246253 if ( status === 'unverified' && externalVerificationRedirectURL ) {
247254 windowNavigate ( externalVerificationRedirectURL ) ;
0 commit comments