MFA fix, added IP blacklist, update webmail client
This commit is contained in:
@@ -56,15 +56,25 @@ func TestWebmailLoginSucceedsAndReachesDashboard(t *testing.T) {
|
||||
t.Fatal("expected a mailbox session cookie to be set")
|
||||
}
|
||||
|
||||
// The webmail root is the mailbox itself now, not account settings — it redirects
|
||||
// straight to the inbox.
|
||||
req2 := httptest.NewRequest(http.MethodGet, MailboxPrefix+"/", nil)
|
||||
req2.AddCookie(sessionCookie)
|
||||
rec2 := httptest.NewRecorder()
|
||||
mux.ServeHTTP(rec2, req2)
|
||||
if rec2.Code != http.StatusOK {
|
||||
t.Fatalf("expected dashboard to render, got %d: %s", rec2.Code, rec2.Body.String())
|
||||
if rec2.Code != http.StatusFound || rec2.Header().Get("Location") != MailboxPrefix+"/mail/INBOX" {
|
||||
t.Fatalf("expected the webmail root to redirect to the inbox, got %d Location=%q", rec2.Code, rec2.Header().Get("Location"))
|
||||
}
|
||||
if !strings.Contains(rec2.Body.String(), "portaluser@example.com") {
|
||||
t.Fatal("expected the dashboard to show the mailbox's own email")
|
||||
|
||||
req3 := httptest.NewRequest(http.MethodGet, MailboxPrefix+"/account", nil)
|
||||
req3.AddCookie(sessionCookie)
|
||||
rec3 := httptest.NewRecorder()
|
||||
mux.ServeHTTP(rec3, req3)
|
||||
if rec3.Code != http.StatusOK {
|
||||
t.Fatalf("expected the account page to render, got %d: %s", rec3.Code, rec3.Body.String())
|
||||
}
|
||||
if !strings.Contains(rec3.Body.String(), "portaluser@example.com") {
|
||||
t.Fatal("expected the account page to show the mailbox's own email")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user