cleanup code, redirect to auth page when need

This commit is contained in:
yusing
2025-01-13 07:15:29 +08:00
parent ef277ef57f
commit 76fe5345d8
11 changed files with 113 additions and 109 deletions

View File

@@ -68,10 +68,10 @@ func TestOIDCLoginHandler(t *testing.T) {
oauthConfig = nil
}
req := httptest.NewRequest(http.MethodGet, "/login/oidc", nil)
req := httptest.NewRequest(http.MethodGet, "/auth/redirect", nil)
w := httptest.NewRecorder()
OIDCLoginHandler(w, req)
RedirectOIDC(w, req)
if got := w.Code; got != tt.wantStatus {
t.Errorf("OIDCLoginHandler() status = %v, want %v", got, tt.wantStatus)