@@ -83,7 +83,7 @@ func (a *API) GetExternalProviderRedirectURL(w http.ResponseWriter, r *http.Requ
8383
8484 flowStateID := ""
8585 if isPKCEFlow (flowType ) {
86- flowState , err := generateFlowState (a . db , providerType , models .OAuth , codeChallengeMethod , codeChallenge , nil )
86+ flowState , err := generateFlowState (db , providerType , models .OAuth , codeChallengeMethod , codeChallenge , nil )
8787 if err != nil {
8888 return "" , err
8989 }
@@ -200,7 +200,7 @@ func (a *API) internalExternalProviderCallback(w http.ResponseWriter, r *http.Re
200200 var flowState * models.FlowState
201201 // if there's a non-empty FlowStateID we perform PKCE Flow
202202 if flowStateID := getFlowStateID (ctx ); flowStateID != "" {
203- flowState , err = models .FindFlowStateByID (a . db , flowStateID )
203+ flowState , err = models .FindFlowStateByID (db , flowStateID )
204204 if models .IsNotFoundError (err ) {
205205 return apierrors .NewUnprocessableEntityError (apierrors .ErrorCodeFlowStateNotFound , "Flow state not found" ).WithInternalError (err )
206206 } else if err != nil {
@@ -506,7 +506,7 @@ func (a *API) processInvite(r *http.Request, tx *storage.Connection, userData *p
506506 return user , nil
507507}
508508
509- func (a * API ) loadExternalState (ctx context.Context , r * http.Request ) (context.Context , error ) {
509+ func (a * API ) loadExternalState (ctx context.Context , r * http.Request , db * storage. Connection ) (context.Context , error ) {
510510 var state string
511511 switch r .Method {
512512 case http .MethodPost :
@@ -564,7 +564,7 @@ func (a *API) loadExternalState(ctx context.Context, r *http.Request) (context.C
564564 if err != nil {
565565 return nil , apierrors .NewBadRequestError (apierrors .ErrorCodeBadOAuthState , "OAuth callback with invalid state (linking_target_id must be UUID)" )
566566 }
567- u , err := models .FindUserByID (a . db , linkingTargetUserID )
567+ u , err := models .FindUserByID (db , linkingTargetUserID )
568568 if err != nil {
569569 if models .IsNotFoundError (err ) {
570570 return nil , apierrors .NewUnprocessableEntityError (apierrors .ErrorCodeUserNotFound , "Linking target user not found" )
0 commit comments