Compare commits

...

2 commits

Author SHA1 Message Date
8874df02d2 added consent check 2022-07-10 01:27:46 +02:00
2f913e40b8 fixed buttons 2022-07-10 01:26:20 +02:00
2 changed files with 4 additions and 5 deletions

View file

@ -259,12 +259,11 @@ func consentHandler(ctx *Context) {
if !ctx.CheckXsrf() {
return
}
// TODO html form
approved := true
consent := ctx.Form("consent")
var err error
rdr := root
if approved {
if consent == "approve" {
rdr, err = ctx.ApproveConsent(data.ConsentChallenge)
if err != nil {
ctx.Error(err)

View file

@ -13,8 +13,8 @@
<form class="form-horizontal" action="/consent" method="post">
<input type="hidden" name="token" value="{{.Token}}">
<input type="hidden" name="consent_challenge" value="{{.Data.ConsentChallenge}}">
<button class="btn btn-sm btn-primary" type="submit" name="Approve">Approve</button>
<button class="btn btn-sm btn-primary" type="submit" name="Reject">Reject</button>
<button class="btn btn-sm btn-success" type="submit" name="consent" value="approve">Approve</button>
<button class="btn btn-sm btn-danger" type="submit" name="consent" value="reject">Reject</button>
</form>
</div>
</div>