First version of OpenAuth remake
This commit is contained in:
51
views/src/authorize/authorize.hbs
Normal file
51
views/src/authorize/authorize.hbs
Normal file
@ -0,0 +1,51 @@
|
||||
<html>
|
||||
|
||||
|
||||
<head>
|
||||
<title>{{title}}</title>
|
||||
<meta charset="utf8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="card">
|
||||
<div class="title">
|
||||
<h1>{{title}}</h1>
|
||||
</div>
|
||||
<div class="list">
|
||||
<hr>
|
||||
<ul>
|
||||
{{#scopes}}
|
||||
<li>
|
||||
<div style="display:inline-block">
|
||||
{{#if logo}}
|
||||
<div class="image">
|
||||
<img width="50px" height="50px" src="{{logo}}">
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="text">
|
||||
<h3 class="scope_title">{{name}}</h3>
|
||||
<p class="scope_description">{{description}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
</li>
|
||||
{{/scopes}}
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
{{information}}
|
||||
</div>
|
||||
<div>
|
||||
<div style="text-align:right;">
|
||||
<button class="mdc-button mdc-button--raised grey-button" id="cancel">Cancel</button>
|
||||
<button class="mdc-button mdc-button--raised blue-button" id="allow">Allow</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form method="post" action="/api/oauth/auth?" id="hidden_form" style="display: none;"></form>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
15
views/src/authorize/authorize.js
Normal file
15
views/src/authorize/authorize.js
Normal file
@ -0,0 +1,15 @@
|
||||
document.getElementById("hidden_form").action += window.location.href.split("?")[1];
|
||||
|
||||
function submit() {
|
||||
document.getElementById("hidden_form").submit();
|
||||
}
|
||||
|
||||
document.getElementById("cancel").onclick = () => {
|
||||
let u = new URL(window.location);
|
||||
let uri = u.searchParams.get("redirect_uri");
|
||||
window.location.href = uri + "?error=access_denied&state=" + u.searchParams.get("state");
|
||||
}
|
||||
|
||||
document.getElementById("allow").onclick = () => {
|
||||
submit()
|
||||
}
|
72
views/src/authorize/authorize.scss
Normal file
72
views/src/authorize/authorize.scss
Normal file
@ -0,0 +1,72 @@
|
||||
@import "@material/button/mdc-button";
|
||||
.blue-button {
|
||||
background: #4a89dc !important;
|
||||
}
|
||||
|
||||
.grey-button {
|
||||
background: #797979 !important;
|
||||
}
|
||||
|
||||
hr {
|
||||
// display: block;
|
||||
// height: 1px;
|
||||
border: 0;
|
||||
border-top: 1px solid #b8b8b8;
|
||||
// margin: 1em 0;
|
||||
// padding: 0;
|
||||
}
|
||||
body {
|
||||
font-family: Helvetica;
|
||||
background: #eee;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
.title {
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
h1, h3 { font-weight: 300; }
|
||||
|
||||
h1 { color: #636363; }
|
||||
|
||||
ul {
|
||||
list-style: none;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.image {
|
||||
display: block;
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.text {
|
||||
display: block;
|
||||
width: calc(100% - 60px);
|
||||
height: 50px;
|
||||
float: right;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.scope_title {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
.scope_description {
|
||||
margin-top: 0;
|
||||
padding-left: 15px;
|
||||
font-size: 13px;
|
||||
color: #202020;
|
||||
}
|
||||
|
||||
.card {
|
||||
max-width: 480px;
|
||||
margin: 4em auto;
|
||||
padding: 3em 2em 2em 2em;
|
||||
background: #fafafa;
|
||||
border: 1px solid #ebebeb;
|
||||
box-shadow: rgba(0,0,0,0.14902) 0px 1px 1px 0px,rgba(0,0,0,0.09804) 0px 1px 2px 0px;
|
||||
}
|
Reference in New Issue
Block a user