mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-26 14:01:14 -07:00
fix(auth): update terminology to 'sign in' and 'sign out' (#20892)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
@@ -34,11 +34,13 @@ describe('authCommand', () => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
it('should have subcommands: login and logout', () => {
|
||||
it('should have subcommands: signin and signout', () => {
|
||||
expect(authCommand.subCommands).toBeDefined();
|
||||
expect(authCommand.subCommands).toHaveLength(2);
|
||||
expect(authCommand.subCommands?.[0]?.name).toBe('login');
|
||||
expect(authCommand.subCommands?.[1]?.name).toBe('logout');
|
||||
expect(authCommand.subCommands?.[0]?.name).toBe('signin');
|
||||
expect(authCommand.subCommands?.[0]?.altNames).toContain('login');
|
||||
expect(authCommand.subCommands?.[1]?.name).toBe('signout');
|
||||
expect(authCommand.subCommands?.[1]?.altNames).toContain('logout');
|
||||
});
|
||||
|
||||
it('should return a dialog action to open the auth dialog when called with no args', () => {
|
||||
@@ -59,19 +61,19 @@ describe('authCommand', () => {
|
||||
expect(authCommand.description).toBe('Manage authentication');
|
||||
});
|
||||
|
||||
describe('auth login subcommand', () => {
|
||||
describe('auth signin subcommand', () => {
|
||||
it('should return auth dialog action', () => {
|
||||
const loginCommand = authCommand.subCommands?.[0];
|
||||
expect(loginCommand?.name).toBe('login');
|
||||
expect(loginCommand?.name).toBe('signin');
|
||||
const result = loginCommand!.action!(mockContext, '');
|
||||
expect(result).toEqual({ type: 'dialog', dialog: 'auth' });
|
||||
});
|
||||
});
|
||||
|
||||
describe('auth logout subcommand', () => {
|
||||
describe('auth signout subcommand', () => {
|
||||
it('should clear cached credentials', async () => {
|
||||
const logoutCommand = authCommand.subCommands?.[1];
|
||||
expect(logoutCommand?.name).toBe('logout');
|
||||
expect(logoutCommand?.name).toBe('signout');
|
||||
|
||||
const { clearCachedCredentialFile } = await import(
|
||||
'@google/gemini-cli-core'
|
||||
|
||||
@@ -14,8 +14,9 @@ import { clearCachedCredentialFile } from '@google/gemini-cli-core';
|
||||
import { SettingScope } from '../../config/settings.js';
|
||||
|
||||
const authLoginCommand: SlashCommand = {
|
||||
name: 'login',
|
||||
description: 'Login or change the auth method',
|
||||
name: 'signin',
|
||||
altNames: ['login'],
|
||||
description: 'Sign in or change the authentication method',
|
||||
kind: CommandKind.BUILT_IN,
|
||||
autoExecute: true,
|
||||
action: (_context, _args): OpenDialogActionReturn => ({
|
||||
@@ -25,8 +26,9 @@ const authLoginCommand: SlashCommand = {
|
||||
};
|
||||
|
||||
const authLogoutCommand: SlashCommand = {
|
||||
name: 'logout',
|
||||
description: 'Log out and clear all cached credentials',
|
||||
name: 'signout',
|
||||
altNames: ['logout'],
|
||||
description: 'Sign out and clear all cached credentials',
|
||||
kind: CommandKind.BUILT_IN,
|
||||
action: async (context, _args): Promise<LogoutActionReturn> => {
|
||||
await clearCachedCredentialFile();
|
||||
|
||||
Reference in New Issue
Block a user