mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
Rename AuthType LOGIN_WITH_GOOGLE_PERSONAL -> LOGIN_WITH_GOOGLE (#2769)
This commit is contained in:
committed by
GitHub
parent
0ca5c07135
commit
3587054d32
@@ -9,7 +9,7 @@ import { loadEnvironment } from './config.js';
|
||||
|
||||
export const validateAuthMethod = (authMethod: string): string | null => {
|
||||
loadEnvironment();
|
||||
if (authMethod === AuthType.LOGIN_WITH_GOOGLE_PERSONAL) {
|
||||
if (authMethod === AuthType.LOGIN_WITH_GOOGLE) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,10 +27,7 @@ export function AuthDialog({
|
||||
initialErrorMessage || null,
|
||||
);
|
||||
const items = [
|
||||
{
|
||||
label: 'Login with Google',
|
||||
value: AuthType.LOGIN_WITH_GOOGLE_PERSONAL,
|
||||
},
|
||||
{ label: 'Login with Google', value: AuthType.LOGIN_WITH_GOOGLE },
|
||||
{ label: 'Gemini API Key (AI Studio)', value: AuthType.USE_GEMINI },
|
||||
{ label: 'Vertex AI', value: AuthType.USE_VERTEX_AI },
|
||||
];
|
||||
|
||||
@@ -1009,7 +1009,7 @@ describe('useGeminiStream', () => {
|
||||
it('should call parseAndFormatApiError with the correct authType on stream initialization failure', async () => {
|
||||
// 1. Setup
|
||||
const mockError = new Error('Rate limit exceeded');
|
||||
const mockAuthType = AuthType.LOGIN_WITH_GOOGLE_PERSONAL;
|
||||
const mockAuthType = AuthType.LOGIN_WITH_GOOGLE;
|
||||
mockParseAndFormatApiError.mockClear();
|
||||
mockSendMessageStream.mockReturnValue(
|
||||
(async function* () {
|
||||
|
||||
@@ -29,7 +29,7 @@ const PrivacyNoticeText = ({
|
||||
return <GeminiPrivacyNotice onExit={onExit} />;
|
||||
case AuthType.USE_VERTEX_AI:
|
||||
return <CloudPaidPrivacyNotice onExit={onExit} />;
|
||||
case AuthType.LOGIN_WITH_GOOGLE_PERSONAL:
|
||||
case AuthType.LOGIN_WITH_GOOGLE:
|
||||
default:
|
||||
return <CloudFreePrivacyNotice config={config} onExit={onExit} />;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ describe('parseAndFormatApiError', () => {
|
||||
'got status: 429 Too Many Requests. {"error":{"code":429,"message":"Rate limit exceeded","status":"RESOURCE_EXHAUSTED"}}';
|
||||
const result = parseAndFormatApiError(
|
||||
errorMessage,
|
||||
AuthType.LOGIN_WITH_GOOGLE_PERSONAL,
|
||||
AuthType.LOGIN_WITH_GOOGLE,
|
||||
);
|
||||
expect(result).toContain('[API Error: Rate limit exceeded');
|
||||
expect(result).toContain(enterpriseMessage);
|
||||
|
||||
@@ -45,7 +45,7 @@ function isStructuredError(error: unknown): error is StructuredError {
|
||||
|
||||
function getRateLimitMessage(authType?: AuthType): string {
|
||||
switch (authType) {
|
||||
case AuthType.LOGIN_WITH_GOOGLE_PERSONAL:
|
||||
case AuthType.LOGIN_WITH_GOOGLE:
|
||||
return RATE_LIMIT_ERROR_MESSAGE_GOOGLE;
|
||||
case AuthType.USE_GEMINI:
|
||||
return RATE_LIMIT_ERROR_MESSAGE_USE_GEMINI;
|
||||
|
||||
Reference in New Issue
Block a user