From 0fd161183680dcf133e57f4d94e9d3f12ee18523 Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Fri, 9 Oct 2020 23:19:53 +0200 Subject: [PATCH] Test bad username in basic auth backend --- auth/basic/basic_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/auth/basic/basic_test.go b/auth/basic/basic_test.go index 80e7247..56dad6d 100644 --- a/auth/basic/basic_test.go +++ b/auth/basic/basic_test.go @@ -15,7 +15,13 @@ func TestBasicLogin(t *testing.T) { t.Error("Error while logging with the basic authentication:", err) } - // Test bad credentials + // Test bad username + ok, err = backend.Login("baduser", "demo") + if ok { + t.Error("Authentification failed to fail:", err) + } + + // Test bad password ok, err = backend.Login("demo", "badpass") if ok { t.Error("Authentification failed to fail:", err)