Skip to content

Commit

Permalink
V1.2 - Register new user (#2)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
eliasjpr authored Nov 9, 2021
1 parent 6e0bc5e commit 0b6e0ae
Show file tree
Hide file tree
Showing 22 changed files with 535 additions and 180 deletions.
193 changes: 193 additions & 0 deletions public/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
body {
color: #999;
background: #f5f5f5;
font-family: 'Roboto', sans-serif;
}

.avatar {
color: #fff;
margin: 0 auto 30px;
text-align: center;
width: 100px;
height: 100px;
border-radius: 50%;
z-index: 9;
background: #2389cd;
padding: 15px;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.1);
}

.avatar i {
font-size: 62px;
}

.form-control {
height: 41px;
background: #f2f2f2;
box-shadow: none !important;
border: none;
}

.form-control:focus {
border-color: #2389cd;
}

.login-form {
width: 400px;
margin: 30px auto;
padding: 30px 0;
}

.login-form form {
color: #999;
border-radius: 3px;
margin-bottom: 15px;
background: #fff;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
padding: 30px;
}

.login-form h4 {
text-align: center;
font-size: 22px;
margin-bottom: 20px;
}

.login-form .form-group {
margin-bottom: 20px;
}

.login-form .form-control,
.login-form .btn {
min-height: 40px;
border-radius: 2px;
transition: all 0.5s;
}

.login-form .close {
position: absolute;
top: 15px;
right: 15px;
}

.login-form .btn,
.login-form .btn:active {
background: #2389cd !important;
border: none;
line-height: normal;
}

.login-form .btn:hover,
.login-form .btn:focus {
background: #2389cd !important;
}

.login-form .checkbox-inline {
float: left;
}

.login-form input[type="checkbox"] {
position: relative;
top: 2px;
}

.login-form .forgot-link {
float: right;
}

.login-form .small {
font-size: 13px;
}

.login-form a {
color: #2389cd;
}

.form-control {
height: 41px;
background: #f2f2f2;
box-shadow: none !important;
border: none;
}

.form-control:focus {
background: #e2e2e2;
}

.form-control,
.btn {
border-radius: 3px;
}

.signup-form {
width: 400px;
margin: 30px auto;
padding: 30px 0;
}

.signup-form form {
color: #999;
border-radius: 3px;
margin-bottom: 15px;
background: #fff;
box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
padding: 30px;
}

.signup-form h2 {
font-size: 22px;
margin-bottom: 20px;

}

.signup-form hr {
margin: 0 -30px 20px;
}

.signup-form .form-group {
margin-bottom: 20px;
}

.signup-form input[type="checkbox"] {
margin-top: 3px;
}

.signup-form .row div:first-child {
padding-right: 10px;
}

.signup-form .row div:last-child {
padding-left: 10px;
}

.signup-form .btn {
font-size: 16px;
font-weight: bold;
background: #3598dc;
border: none;
min-width: 140px;
}

.signup-form .btn:hover,
.signup-form .btn:focus {
background: #2389cd !important;
outline: none;
}

.signup-form a:hover {
text-decoration: none;
}

.signup-form form a {
color: #3598dc;
text-decoration: none;
}

.signup-form form a:hover {
text-decoration: underline;
}

.signup-form .hint-text {
padding-bottom: 15px;
text-align: center;
}
39 changes: 0 additions & 39 deletions public/css/signin.css

This file was deleted.

105 changes: 36 additions & 69 deletions public/templates/authorize.html
Original file line number Diff line number Diff line change
@@ -1,78 +1,45 @@
<!doctype html>
<html lang="en">
{% extends "layout.html" %}
{% set title = "Authorize" %}

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

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

<style>
body {
background-color: #f4f4f4;
}

.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
<img src="{{client.logo}}" width="100%">

@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
</style>
</head>
<hr />

<body>
<main class="container">
<div class="row justify-content-md-center">
<div class="col col-lg-6 mt-5">
<form method="post" action="{{authorize_endpoint}}">
<input type="hidden" name="response_type" value="{{response_type}}" />
<input type="hidden" name="state" value="{{state}}" />
<input type="hidden" name="client_id" value="{{client.client_id}}" />
<input type="hidden" name="redirect_uri" value="{{client.redirect_uri}}" />
<input type="hidden" name="scope" value="{{scope}}" />
<input type="hidden" name="code_challenge" value="{{code_challenge}}" />
<input type="hidden" name="code_challenge_method" value="{{code_challenge_method}}" />
<div class="card">
<img src="{{client.logo}}" class="card-img-top">
<div class="card-body">
<h5 class="card-title">{{client.name}}</h5>
<p class="card-text">{{client.description}}</p>
</div>
<div class="card-footer">
<div class="d-grid gap-2 mt-2">
<button type="submit" id="approve" name="approve" class="authorize-btn btn btn-success btn-lg">
Authorize {{client.name}}
</button>
<p class="text-center mt-1">
Authorizing will redirect to
<strong>{{client.redirect_uri}}</strong>
</p>
</div>
</div>
</form>
</div>
</div>
</main>
<h4 class="modal-title">{{client.name}}</h4>
<p class="text-center">{{client.description}}</p>

<br />

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

</body>
<div class="d-grid gap-2 mx-auto">
<button type="submit" id="approve" name="approve" class="btn btn-primary btn-block btn-lg">
Authorize {{client.name}}
</button>
</div>

<br />

</html>
<p class="text-center small">
Authorizing will redirect to
<br />
<strong>{{client.redirect_uri}}</strong>
</p>
</div>
</form>
</main>
{% endblock %}
12 changes: 12 additions & 0 deletions public/templates/errors.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% if errors %}
<div class="alert alert-warning alert-dismissible fade show text-start" role="alert">
<h4 class="alert-heading">Oops!</h4>
<button type="button" class="btn-close btn-sm" data-bs-dismiss="alert" aria-label="Close"></button>

{% for error in errors %}
<div>
{{error | capitalize | safe}}
</div>
{% endfor %}
</div>
{% endif %}
11 changes: 11 additions & 0 deletions public/templates/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
{% block page_title %}<title>Authority - {{title}}</title>{% endblock %}
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Merienda+One">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="/css/main.css">
</head>
18 changes: 18 additions & 0 deletions public/templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
{% block header %}
{% include "header.html" %}
{% endblock %}

<body>

{% block body %}
{% endblock %}
</div>

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous">
</script>
</body>

</html>
Loading

0 comments on commit 0b6e0ae

Please sign in to comment.