Compare commits
2 commits
3c3ca3e7a7
...
8874df02d2
| Author | SHA1 | Date | |
|---|---|---|---|
| 8874df02d2 | |||
| 2f913e40b8 |
2 changed files with 4 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue