MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / TestHandleCallback_InvalidState_Rejected

Function TestHandleCallback_InvalidState_Rejected

internal/auth/cli_login_test.go:386–403  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

384}
385
386func TestHandleCallback_InvalidState_Rejected(t *testing.T) {
387 ua, _, srv := setupUserAuthWithFakeOAuth(t)
388
389 req := httptest.NewRequest(
390 http.MethodGet,
391 "/api/auth/callback?code=fake-code&state=not-valid-base64!!!",
392 nil,
393 )
394 req.AddCookie(&http.Cookie{Name: "e2a_oauth_state", Value: "whatever"})
395 _ = srv
396 w := httptest.NewRecorder()
397
398 ua.HandleCallback(w, req)
399
400 if w.Code != http.StatusBadRequest {
401 t.Fatalf("status = %d, want %d", w.Code, http.StatusBadRequest)
402 }
403}

Callers

nothing calls this directly

Calls 2

HandleCallbackMethod · 0.80

Tested by

no test coverage detected