oidc: automatically submit consent form

Fixes #828
This commit is contained in:
Johannes Zellner
2023-06-20 19:58:09 +02:00
parent 79d9cce2e7
commit 4fe055c3a8
2 changed files with 15 additions and 11 deletions

View File

@@ -50,6 +50,11 @@
</head>
<body>
<% if (hasAccess) { -%>
<form id="submitForm" method="post" action="<%= submitUrl %>">
<!-- <button type="submit"></button> -->
</form>
<% } else { -%>
<div class="layout-root">
<div class="layout-content">
<div class="card">
@@ -57,28 +62,27 @@
<div class="col-md-12" style="text-align: center;">
<img width="128" height="128" class="avatar" src="<%= iconUrl %>"/>
<br/>
<% if (hasAccess) { -%>
<h3>Authorize <b><%= name %></b></h3>
<% } else { -%>
<h3>You do not have access to <b><%= name %></b></h3>
<% } -%>
</div>
</div>
<br/>
<div class="row">
<div class="col-md-12 text-center">
<% if (hasAccess) { -%>
<form method="post" action="<%= submitUrl %>">
<button class="btn btn-primary btn-outline" type="submit">Authorize</button>
</form>
<% } else { -%>
<a class="btn btn-primary btn-outline" href="<%= submitUrl %>">Continue</a>
<% } -%>
</div>
</div>
</div>
</div>
</div>
<% } -%>
<script>
<% if (hasAccess) { -%>
document.getElementById('submitForm').submit();
<% } -%>
</script>
</body>
</html>