fix: pass CSRFField to dashboard template (closes #146)
All checks were successful
Check / check (pull_request) Successful in 2m30s
All checks were successful
Check / check (pull_request) Successful in 2m30s
This commit is contained in:
@@ -419,7 +419,8 @@ func TestHandleDashboard(t *testing.T) {
|
|||||||
handler := testCtx.handlers.HandleDashboard()
|
handler := testCtx.handlers.HandleDashboard()
|
||||||
handler.ServeHTTP(recorder, request)
|
handler.ServeHTTP(recorder, request)
|
||||||
|
|
||||||
assert.Equal(t, http.StatusOK, recorder.Code, "dashboard should not 500 when apps exist (CSRFField must be accessible)")
|
assert.Equal(t, http.StatusOK, recorder.Code,
|
||||||
|
"dashboard should not 500 when apps exist (CSRFField must be accessible)")
|
||||||
assert.Contains(t, recorder.Body.String(), "csrf-test-app")
|
assert.Contains(t, recorder.Body.String(), "csrf-test-app")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
<a href="/apps/{{.App.ID}}" class="btn-text text-sm py-1 px-2">View</a>
|
<a href="/apps/{{.App.ID}}" class="btn-text text-sm py-1 px-2">View</a>
|
||||||
<a href="/apps/{{.App.ID}}/edit" class="btn-secondary text-sm py-1 px-2">Edit</a>
|
<a href="/apps/{{.App.ID}}/edit" class="btn-secondary text-sm py-1 px-2">Edit</a>
|
||||||
<form method="POST" action="/apps/{{.App.ID}}/deploy" class="inline">
|
<form method="POST" action="/apps/{{.App.ID}}/deploy" class="inline">
|
||||||
{{ .CSRFField }}
|
{{ $.CSRFField }}
|
||||||
<button type="submit" class="btn-success text-sm py-1 px-2">Deploy</button>
|
<button type="submit" class="btn-success text-sm py-1 px-2">Deploy</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user