Skip to content

Commit 0b6e0ae

Browse files
authored
V1.2 - Register new user (#2)
* v1.2 Registers New Owner - Renames Models to Entities - Adds Repositories for Clients and Users - Uses UUID for table primary keys - Uses UUID for Client ID - Adds Name and Logo to Clients table - Improves templates design
1 parent 6e0bc5e commit 0b6e0ae

22 files changed

+535
-180
lines changed

public/css/main.css

+193
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
body {
2+
color: #999;
3+
background: #f5f5f5;
4+
font-family: 'Roboto', sans-serif;
5+
}
6+
7+
.avatar {
8+
color: #fff;
9+
margin: 0 auto 30px;
10+
text-align: center;
11+
width: 100px;
12+
height: 100px;
13+
border-radius: 50%;
14+
z-index: 9;
15+
background: #2389cd;
16+
padding: 15px;
17+
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.1);
18+
}
19+
20+
.avatar i {
21+
font-size: 62px;
22+
}
23+
24+
.form-control {
25+
height: 41px;
26+
background: #f2f2f2;
27+
box-shadow: none !important;
28+
border: none;
29+
}
30+
31+
.form-control:focus {
32+
border-color: #2389cd;
33+
}
34+
35+
.login-form {
36+
width: 400px;
37+
margin: 30px auto;
38+
padding: 30px 0;
39+
}
40+
41+
.login-form form {
42+
color: #999;
43+
border-radius: 3px;
44+
margin-bottom: 15px;
45+
background: #fff;
46+
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
47+
padding: 30px;
48+
}
49+
50+
.login-form h4 {
51+
text-align: center;
52+
font-size: 22px;
53+
margin-bottom: 20px;
54+
}
55+
56+
.login-form .form-group {
57+
margin-bottom: 20px;
58+
}
59+
60+
.login-form .form-control,
61+
.login-form .btn {
62+
min-height: 40px;
63+
border-radius: 2px;
64+
transition: all 0.5s;
65+
}
66+
67+
.login-form .close {
68+
position: absolute;
69+
top: 15px;
70+
right: 15px;
71+
}
72+
73+
.login-form .btn,
74+
.login-form .btn:active {
75+
background: #2389cd !important;
76+
border: none;
77+
line-height: normal;
78+
}
79+
80+
.login-form .btn:hover,
81+
.login-form .btn:focus {
82+
background: #2389cd !important;
83+
}
84+
85+
.login-form .checkbox-inline {
86+
float: left;
87+
}
88+
89+
.login-form input[type="checkbox"] {
90+
position: relative;
91+
top: 2px;
92+
}
93+
94+
.login-form .forgot-link {
95+
float: right;
96+
}
97+
98+
.login-form .small {
99+
font-size: 13px;
100+
}
101+
102+
.login-form a {
103+
color: #2389cd;
104+
}
105+
106+
.form-control {
107+
height: 41px;
108+
background: #f2f2f2;
109+
box-shadow: none !important;
110+
border: none;
111+
}
112+
113+
.form-control:focus {
114+
background: #e2e2e2;
115+
}
116+
117+
.form-control,
118+
.btn {
119+
border-radius: 3px;
120+
}
121+
122+
.signup-form {
123+
width: 400px;
124+
margin: 30px auto;
125+
padding: 30px 0;
126+
}
127+
128+
.signup-form form {
129+
color: #999;
130+
border-radius: 3px;
131+
margin-bottom: 15px;
132+
background: #fff;
133+
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
134+
padding: 30px;
135+
}
136+
137+
.signup-form h2 {
138+
font-size: 22px;
139+
margin-bottom: 20px;
140+
141+
}
142+
143+
.signup-form hr {
144+
margin: 0 -30px 20px;
145+
}
146+
147+
.signup-form .form-group {
148+
margin-bottom: 20px;
149+
}
150+
151+
.signup-form input[type="checkbox"] {
152+
margin-top: 3px;
153+
}
154+
155+
.signup-form .row div:first-child {
156+
padding-right: 10px;
157+
}
158+
159+
.signup-form .row div:last-child {
160+
padding-left: 10px;
161+
}
162+
163+
.signup-form .btn {
164+
font-size: 16px;
165+
font-weight: bold;
166+
background: #3598dc;
167+
border: none;
168+
min-width: 140px;
169+
}
170+
171+
.signup-form .btn:hover,
172+
.signup-form .btn:focus {
173+
background: #2389cd !important;
174+
outline: none;
175+
}
176+
177+
.signup-form a:hover {
178+
text-decoration: none;
179+
}
180+
181+
.signup-form form a {
182+
color: #3598dc;
183+
text-decoration: none;
184+
}
185+
186+
.signup-form form a:hover {
187+
text-decoration: underline;
188+
}
189+
190+
.signup-form .hint-text {
191+
padding-bottom: 15px;
192+
text-align: center;
193+
}

public/css/signin.css

-39
This file was deleted.

public/templates/authorize.html

+36-69
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,45 @@
1-
<!doctype html>
2-
<html lang="en">
1+
{% extends "layout.html" %}
2+
{% set title = "Authorize" %}
33

4-
<head>
5-
<meta charset="utf-8">
6-
<meta name="viewport" content="width=device-width, initial-scale=1">
7-
<meta name="description" content="">
8-
<meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
9-
<meta name="generator" content="Hugo 0.84.0">
10-
<title>Authority - Authorize {{client.name}}</title>
4+
{% block body %}
5+
<main class="login-form">
116

12-
<!-- Bootstrap core CSS -->
13-
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
14-
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
15-
<meta name="theme-color" content="#7952b3">
7+
{% include "errors.html" %}
8+
<form method="post" action="{{authorize_endpoint}}">
9+
<input type="hidden" name="response_type" value="{{response_type}}" />
10+
<input type="hidden" name="state" value="{{state}}" />
11+
<input type="hidden" name="client_id" value="{{client.client_id}}" />
12+
<input type="hidden" name="redirect_uri" value="{{client.redirect_uri}}" />
13+
<input type="hidden" name="scope" value="{{scope}}" />
14+
<input type="hidden" name="code_challenge" value="{{code_challenge}}" />
15+
<input type="hidden" name="code_challenge_method" value="{{code_challenge_method}}" />
1616

17-
<style>
18-
body {
19-
background-color: #f4f4f4;
20-
}
2117

22-
.bd-placeholder-img {
23-
font-size: 1.125rem;
24-
text-anchor: middle;
25-
-webkit-user-select: none;
26-
-moz-user-select: none;
27-
user-select: none;
28-
}
18+
<img src="{{client.logo}}" width="100%">
2919

30-
@media (min-width: 768px) {
31-
.bd-placeholder-img-lg {
32-
font-size: 3.5rem;
33-
}
34-
}
35-
</style>
36-
</head>
20+
<hr />
3721

38-
<body>
39-
<main class="container">
40-
<div class="row justify-content-md-center">
41-
<div class="col col-lg-6 mt-5">
42-
<form method="post" action="{{authorize_endpoint}}">
43-
<input type="hidden" name="response_type" value="{{response_type}}" />
44-
<input type="hidden" name="state" value="{{state}}" />
45-
<input type="hidden" name="client_id" value="{{client.client_id}}" />
46-
<input type="hidden" name="redirect_uri" value="{{client.redirect_uri}}" />
47-
<input type="hidden" name="scope" value="{{scope}}" />
48-
<input type="hidden" name="code_challenge" value="{{code_challenge}}" />
49-
<input type="hidden" name="code_challenge_method" value="{{code_challenge_method}}" />
50-
<div class="card">
51-
<img src="{{client.logo}}" class="card-img-top">
52-
<div class="card-body">
53-
<h5 class="card-title">{{client.name}}</h5>
54-
<p class="card-text">{{client.description}}</p>
55-
</div>
56-
<div class="card-footer">
57-
<div class="d-grid gap-2 mt-2">
58-
<button type="submit" id="approve" name="approve" class="authorize-btn btn btn-success btn-lg">
59-
Authorize {{client.name}}
60-
</button>
61-
<p class="text-center mt-1">
62-
Authorizing will redirect to
63-
<strong>{{client.redirect_uri}}</strong>
64-
</p>
65-
</div>
66-
</div>
67-
</form>
68-
</div>
69-
</div>
70-
</main>
22+
<h4 class="modal-title">{{client.name}}</h4>
23+
<p class="text-center">{{client.description}}</p>
24+
25+
<br />
7126

72-
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
73-
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous">
74-
</script>
27+
<div class="form-group">
7528

76-
</body>
29+
<div class="d-grid gap-2 mx-auto">
30+
<button type="submit" id="approve" name="approve" class="btn btn-primary btn-block btn-lg">
31+
Authorize {{client.name}}
32+
</button>
33+
</div>
34+
35+
<br />
7736

78-
</html>
37+
<p class="text-center small">
38+
Authorizing will redirect to
39+
<br />
40+
<strong>{{client.redirect_uri}}</strong>
41+
</p>
42+
</div>
43+
</form>
44+
</main>
45+
{% endblock %}

public/templates/errors.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{% if errors %}
2+
<div class="alert alert-warning alert-dismissible fade show text-start" role="alert">
3+
<h4 class="alert-heading">Oops!</h4>
4+
<button type="button" class="btn-close btn-sm" data-bs-dismiss="alert" aria-label="Close"></button>
5+
6+
{% for error in errors %}
7+
<div>
8+
{{error | capitalize | safe}}
9+
</div>
10+
{% endfor %}
11+
</div>
12+
{% endif %}

public/templates/header.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<head>
2+
<meta charset="utf-8">
3+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
4+
{% block page_title %}<title>Authority - {{title}}</title>{% endblock %}
5+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Merienda+One">
6+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
7+
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
8+
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
9+
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
10+
<link rel="stylesheet" href="/css/main.css">
11+
</head>

public/templates/layout.html

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
{% block header %}
4+
{% include "header.html" %}
5+
{% endblock %}
6+
7+
<body>
8+
9+
{% block body %}
10+
{% endblock %}
11+
</div>
12+
13+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
14+
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous">
15+
</script>
16+
</body>
17+
18+
</html>

0 commit comments

Comments
 (0)