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() {
|
if !ctx.CheckXsrf() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// TODO html form
|
consent := ctx.Form("consent")
|
||||||
approved := true
|
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
rdr := root
|
rdr := root
|
||||||
if approved {
|
if consent == "approve" {
|
||||||
rdr, err = ctx.ApproveConsent(data.ConsentChallenge)
|
rdr, err = ctx.ApproveConsent(data.ConsentChallenge)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.Error(err)
|
ctx.Error(err)
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@
|
||||||
<form class="form-horizontal" action="/consent" method="post">
|
<form class="form-horizontal" action="/consent" method="post">
|
||||||
<input type="hidden" name="token" value="{{.Token}}">
|
<input type="hidden" name="token" value="{{.Token}}">
|
||||||
<input type="hidden" name="consent_challenge" value="{{.Data.ConsentChallenge}}">
|
<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-success" type="submit" name="consent" value="approve">Approve</button>
|
||||||
<button class="btn btn-sm btn-primary" type="submit" name="Reject">Reject</button>
|
<button class="btn btn-sm btn-danger" type="submit" name="consent" value="reject">Reject</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue