Skip to content

Commit

Permalink
login: save cookies when relogining
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Dec 13, 2024
1 parent 72b7749 commit c8e10e0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/connector/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ func (gl *GoogleLoginProcess) SubmitCookies(ctx context.Context, cookies map[str
} else if err = cli.Client.Connect(); err != nil {
zerolog.Ctx(ctx).Err(err).Msg("Failed to reconnect existing client after Google relogin")
} else {
err = gl.Override.Save(ctx)
if err != nil {
err = fmt.Errorf("failed to save cookies after relogin: %w", err)
}
return &bridgev2.LoginStep{
Type: bridgev2.LoginStepTypeComplete,
StepID: LoginStepIDComplete,
Expand All @@ -274,7 +278,7 @@ func (gl *GoogleLoginProcess) SubmitCookies(ctx context.Context, cookies map[str
UserLoginID: gl.Override.ID,
UserLogin: gl.Override,
},
}, nil
}, err
}
meta.Session.SetCookies(nil)
}
Expand Down

0 comments on commit c8e10e0

Please sign in to comment.