refactor(auth): save authType after successfully authenticated (#1036)

This commit is contained in:
Mingholy 2025-11-19 11:21:46 +08:00 committed by GitHub
parent 3ed93d5b5d
commit d0e76c76a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 822 additions and 518 deletions

View file

@ -562,7 +562,7 @@ export class Config {
}
}
async refreshAuth(authMethod: AuthType) {
async refreshAuth(authMethod: AuthType, isInitialAuth?: boolean) {
// Vertex and Genai have incompatible encryption and sending history with
// throughtSignature from Genai to Vertex will fail, we need to strip them
if (
@ -582,6 +582,7 @@ export class Config {
newContentGeneratorConfig,
this,
this.getSessionId(),
isInitialAuth,
);
// Only assign to instance properties after successful initialization
this.contentGeneratorConfig = newContentGeneratorConfig;