mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
fix(auth): make logout reject only the credential tea stored
Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
6 files changed
+50
-28
No files matched your search
@@ -777,7 +777,7 @@ func TestLogoutAsksGitToForgetTheAccount(t *testing.T) {
|
||||
deps.Git = runner
|
||||
configureAccounts(t, deps, instance, "alice", "alice", "bob")
|
||||
require.NoError(t, Execute(context.Background(), deps, []string{"auth", "logout", "--yes"}))
|
||||
require.Equal(t, []string{"credential reject\nprotocol=https\nhost=example.org:3000\nusername=alice\n\n"}, runner.inputs)
|
||||
require.Equal(t, []string{"credential reject\nprotocol=https\nhost=example.org:3000\nusername=alice\npassword=alice-token\n\n"}, runner.inputs)
|
||||
require.Equal(t, "✓ Logged out of "+instance+" (alice)\n✓ Switched active account for "+instance+" to bob\n", withoutANSI(diagnostics.String()))
|
||||
err := Execute(context.Background(), deps, []string{"auth", "logout", "carol", "--yes"})
|
||||
require.EqualError(t, err, `account "carol" is not logged in on `+instance+" (accounts: bob)")
|
||||
|
||||
Reference in new issue
Block a user