aboutsummaryrefslogtreecommitdiff
path: root/gn_auth/templates
diff options
context:
space:
mode:
Diffstat (limited to 'gn_auth/templates')
-rw-r--r--gn_auth/templates/admin/confirm-change-client-secret.html45
-rw-r--r--gn_auth/templates/admin/list-oauth2-clients.html10
-rw-r--r--gn_auth/templates/base.html4
-rw-r--r--gn_auth/templates/emails/forgot-password.html38
-rw-r--r--gn_auth/templates/emails/forgot-password.txt12
-rw-r--r--gn_auth/templates/emails/verify-email.html2
-rw-r--r--gn_auth/templates/emails/verify-email.txt2
-rw-r--r--gn_auth/templates/oauth2/authorise-user.html84
-rw-r--r--gn_auth/templates/users/change-password.html52
-rw-r--r--gn_auth/templates/users/forgot-password-token-send-success.html22
-rw-r--r--gn_auth/templates/users/forgot-password.html38
11 files changed, 274 insertions, 35 deletions
diff --git a/gn_auth/templates/admin/confirm-change-client-secret.html b/gn_auth/templates/admin/confirm-change-client-secret.html
new file mode 100644
index 0000000..aa8ef81
--- /dev/null
+++ b/gn_auth/templates/admin/confirm-change-client-secret.html
@@ -0,0 +1,45 @@
+{%extends "base.html"%}
+
+{%block title%}gn-auth: View OAuth2 Client{%endblock%}
+
+{%block pagetitle%}View OAuth2 Client{%endblock%}
+
+{%block content%}
+{{flash_messages()}}
+
+<h2>Change Oauth2 Client Secret</h2>
+
+<p>You are attempting to change the <strong>CLIENT_SECRET</strong> value for the
+ following client:</p>
+
+<table class="table">
+ <tbody>
+ <tr>
+ <td><strong>Client ID</strong></td>
+ <td>{{client.client_id}}</td>
+ </tr>
+ <tr>
+ <td><strong>Client Name</strong></td>
+ <td>{{client.client_metadata.client_name}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<p>Are you absolutely sure you want to do this?<br />
+ <small>Note that you'll need to update your configurations for the client and
+ restart it for the settings to take effect!</small></p>
+
+<form id="frm-change-client-secret"
+ method="POST"
+ action="{{url_for('oauth2.admin.change_client_secret',
+ client_id=client.client_id)}}">
+
+ <input type="hidden" name="client_id" value="{{client.client_id}}" />
+ <input type="hidden" name="client_name" value="{{client.client_metadata.client_name}}" />
+
+ <div class="form-group">
+ <input type="submit" class="btn btn-danger" value="generate new secret" />
+ </div>
+</form>
+
+{%endblock%}
diff --git a/gn_auth/templates/admin/list-oauth2-clients.html b/gn_auth/templates/admin/list-oauth2-clients.html
index ca0ee6d..6da5b2f 100644
--- a/gn_auth/templates/admin/list-oauth2-clients.html
+++ b/gn_auth/templates/admin/list-oauth2-clients.html
@@ -15,7 +15,7 @@
<th>Client Name</th>
<th>Default Redirect URI</th>
<th>Owner</th>
- <th colspan="2">Actions</th>
+ <th colspan="3">Actions</th>
</tr>
</thead>
@@ -43,6 +43,14 @@
class="btn btn-danger" />
</form>
</td>
+ <td>
+ <a href="{{url_for('oauth2.admin.change_client_secret',
+ client_id=client.client_id)}}"
+ title="Change the client secret!"
+ class="btn btn-danger">
+ Change Secret
+ </a>
+ </td>
</tr>
{%else%}
<tr>
diff --git a/gn_auth/templates/base.html b/gn_auth/templates/base.html
index b452ca1..c90ac9b 100644
--- a/gn_auth/templates/base.html
+++ b/gn_auth/templates/base.html
@@ -5,7 +5,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>gn-auth: {%block title%}{%endblock%}</title>
+ <title>Authorization {%block title%}{%endblock%}</title>
<link rel="stylesheet" type="text/css"
href="https://genenetwork.org/static/new/css/bootstrap-custom.css" />
@@ -39,7 +39,7 @@
style="font-weight: bold;">GeneNetwork</a>
</li>
<li>
- <a href="#">gn-auth: {%block pagetitle%}{%endblock%}</a>
+ <a href="#">{%block pagetitle%}{%endblock%}</a>
</li>
</ul>
</div>
diff --git a/gn_auth/templates/emails/forgot-password.html b/gn_auth/templates/emails/forgot-password.html
new file mode 100644
index 0000000..5f16a02
--- /dev/null
+++ b/gn_auth/templates/emails/forgot-password.html
@@ -0,0 +1,38 @@
+<html>
+ <head>
+ <meta charset="UTF-8" />
+ <title>{{subject}}</title>
+ </head>
+ <body>
+ <p>
+ You (or someone pretending to be you) made a request to change your
+ password. Please follow the link below to change it.
+ </p>
+
+ <p>
+ Click the button below to change your password
+ <a href="{{forgot_password_uri}}"
+ style="display: block;text-align: center;vertical-align: center;cursor: pointer;border-radius: 4px;background-color: #336699;border-color: #357ebd;color: white;text-decoration: none;font-size: large;width: 9em;text-transform: capitalize;margin: 1em 0 0 3em;box-shadow: 2px 2px rgba(0, 0, 0, 0.3);">Change my Password</a>.</p>
+
+ <p>
+ Or copy the link below onto your browser's address bar:<br /><br />
+ <span style="font-weight: bolder;">{{forgot_password_uri}}</span>
+ </p>
+
+ <p>
+ If you did not request to change your password, simply ignore this email.
+ </p>
+
+ <p style="font-weight: bold;color: #ee55ee;">
+ The link will expire in <strong>{{expiration_minutes}}</strong>.
+ </p>
+
+ <hr />
+ <p>
+ <small>
+ Note that if you requested to change your password multiple times, only
+ the latest/newest token will be valid.
+ </small>
+ </p>
+ </body>
+</html>
diff --git a/gn_auth/templates/emails/forgot-password.txt b/gn_auth/templates/emails/forgot-password.txt
new file mode 100644
index 0000000..68abf16
--- /dev/null
+++ b/gn_auth/templates/emails/forgot-password.txt
@@ -0,0 +1,12 @@
+{{subject}}
+===============
+
+You (or someone pretending to be you) made a request to change your password. Please copy the link below onto your browser to change your password:
+
+{{forgot_password_uri}}
+
+If you did not request to change your password, simply ignore this email.
+
+The link will expire in {{expiration_minutes}}.
+
+Note that if you requested to change your password multiple times, only the latest/newest token will be valid.
diff --git a/gn_auth/templates/emails/verify-email.html b/gn_auth/templates/emails/verify-email.html
index 7f85c1c..11ae575 100644
--- a/gn_auth/templates/emails/verify-email.html
+++ b/gn_auth/templates/emails/verify-email.html
@@ -20,7 +20,7 @@
<p style="font-weight: bold;color: #ee55ee;">
Please note that the verification code will expire in
- <strong>{{expiration_minutes}}</strong> minutes after it was generated.
+ <strong>{{expiration_minutes}}</strong> after it was generated.
</p>
</body>
</html>
diff --git a/gn_auth/templates/emails/verify-email.txt b/gn_auth/templates/emails/verify-email.txt
index 281d682..ecfbfc0 100644
--- a/gn_auth/templates/emails/verify-email.txt
+++ b/gn_auth/templates/emails/verify-email.txt
@@ -9,4 +9,4 @@ If that does not work, please log in to GeneNetwork and copy the verification co
{{verification_code}}
-Please note that the verification code will expire {{expiration_minutes}} minutes after it was generated.
+Please note that the verification code will expire {{expiration_minutes}} after it was generated.
diff --git a/gn_auth/templates/oauth2/authorise-user.html b/gn_auth/templates/oauth2/authorise-user.html
index 07edb73..f186167 100644
--- a/gn_auth/templates/oauth2/authorise-user.html
+++ b/gn_auth/templates/oauth2/authorise-user.html
@@ -2,41 +2,65 @@
{%block title%}Authorise User{%endblock%}
-{%block pagetitle%}Authenticate to the API Server{%endblock%}
+{%block pagetitle%}{%endblock%}
{%block content%}
{{flash_messages()}}
+<div class="container" style="min-width: 1250px;">
+ <form method="POST"
+ class="form-horizontal"
+ action="{{url_for(
+ 'oauth2.auth.authorise',
+ response_type=response_type,
+ client_id=client.client_id,
+ redirect_uri=redirect_uri)}}"
+ style="max-width: 700px;">
+ <legend style="margin-top: 20px;">Sign In</legend>
-<form method="POST" action="{{url_for(
- 'oauth2.auth.authorise',
- response_type=response_type,
- client_id=client.client_id,
- redirect_uri=redirect_uri)}}">
- <input type="hidden" name="response_type" value="{{response_type}}" />
- <input type="hidden" name="redirect_uri" value="{{redirect_uri}}" />
- <input type="hidden" name="scope" value="{{scope | join(' ')}}" />
- <input type="hidden" name="client_id" value="{{client.client_id}}" />
+ <input type="hidden" name="response_type" value="{{response_type}}" />
+ <input type="hidden" name="redirect_uri" value="{{redirect_uri}}" />
+ <input type="hidden" name="scope" value="{{scope | join(' ')}}" />
+ <input type="hidden" name="client_id" value="{{client.client_id}}" />
- <legend>User Credentials</legend>
- <div class="form-group">
- <label for="user:email" class="form-label">Email</label>
- <input type="email" name="user:email" id="user:email" required="required"
- class="form-control"/>
- </div>
+ <div class="form-group">
+ <label for="user:email" class="control-label col-xs-2"
+ style="text-align: left;">Email</label>
+ <div class="col-xs-10">
+ <input type="email"
+ name="user:email"
+ id="user:email"
+ required="required"
+ class="form-control" />
+ </div>
+ </div>
- <div class="form-group">
- <label for="user:password" class="form-label">Password</label>
- <input type="password" name="user:password" id="user:password"
- required="required" class="form-control" />
- </div>
+ <div class="form-group">
+ <label for="user:password" class="control-label col-xs-2"
+ style="text-align: left;">Password</label>
+ <div class="col-xs-10">
+ <input type="password"
+ name="user:password"
+ id="user:password"
+ required="required"
+ class="form-control" />
+ </div>
+ </div>
- <div class="form-group">
- <input type="submit" value="authorise" class="btn btn-primary" />
- {%if display_forgot_password%}
- <a href="{{url_for('oauth2.users.forgot_password')}}"
- title="Click here to change your password."
- class="form-text text-danger">Forgot Password</a>
- {%endif%}
- </div>
-</form>
+ <div class="form-group">
+ <div class="controls col-xs-offset-2 col-xs-10">
+ <input type="submit" value="Sign in" class="btn btn-primary" />
+ {%if display_forgot_password%}
+ <a href="{{url_for('oauth2.users.forgot_password',
+ client_id=client.client_id,
+ redirect_uri=redirect_uri,
+ response_type=response_type)}}"
+ title="Click here to change your password."
+ class="form-text text-danger">Forgot Password</a>
+ {%endif%}
+ </div>
+ </div>
+ <hr>
+ <a href="{{ source_uri }}/oauth2/user/register" class="btn btn-primary" role="button">Create a New Account</a>
+ </form>
+</div>
{%endblock%}
diff --git a/gn_auth/templates/users/change-password.html b/gn_auth/templates/users/change-password.html
new file mode 100644
index 0000000..f328255
--- /dev/null
+++ b/gn_auth/templates/users/change-password.html
@@ -0,0 +1,52 @@
+{%extends "base.html"%}
+
+{%block title%}gn-auth: Change Password{%endblock%}
+
+{%block pagetitle%}Change Password{%endblock%}
+
+{%block content%}
+{{flash_messages()}}
+
+<div class="container-fluid">
+ <div class="row"><h1>Change Password</h1></div>
+
+ <div class="row">
+ <form method="POST"
+ action="{{url_for('oauth2.users.change_password',
+ client_id=client_id,
+ redirect_uri=redirect_uri,
+ response_type=response_type,
+ forgot_password_token=forgot_password_token)}}">
+ <div class="form-group">
+ <p class="form-text text-info">
+ Change the password for your account with the email
+ "<strong>{{email}}</strong>".
+ </p>
+ </div>
+
+ <div class="form-group">
+ <label for="txt-password" class="form-label">New Password</label>
+ <input type="password"
+ id="txt-password"
+ name="password"
+ class="form-control"
+ required="required" />
+ </div>
+
+ <div class="form-group">
+ <label for="txt-confirm" class="form-label">Confirm New Password</label>
+ <input type="password"
+ id="txt-confirm"
+ name="confirm-password"
+ class="form-control"
+ required="required" />
+ </div>
+
+ <div class="form-group">
+ <input type="submit" class="btn btn-danger" value="change password" />
+ </div>
+ </form>
+ </div>
+
+</div>
+{%endblock%}
diff --git a/gn_auth/templates/users/forgot-password-token-send-success.html b/gn_auth/templates/users/forgot-password-token-send-success.html
new file mode 100644
index 0000000..8782e8c
--- /dev/null
+++ b/gn_auth/templates/users/forgot-password-token-send-success.html
@@ -0,0 +1,22 @@
+{%extends "base.html"%}
+
+{%block title%}gn-auth: Forgot Password{%endblock%}
+
+{%block pagetitle%}Forgot Password{%endblock%}
+
+{%block content%}
+{{flash_messages()}}
+
+<div class="container-fluid">
+ <div class="row"><h1>Forgot Password</h1></div>
+
+ <div class="row">
+ <p class="text-info"
+ style="font-size:1.5em;text-align:center;margin-top:2em;">
+ We have sent an email to '<strong>{{email}}</strong>'. Please use the link
+ in the email we sent to change your password.
+ </p>
+ </div>
+
+</div>
+{%endblock%}
diff --git a/gn_auth/templates/users/forgot-password.html b/gn_auth/templates/users/forgot-password.html
new file mode 100644
index 0000000..0455c69
--- /dev/null
+++ b/gn_auth/templates/users/forgot-password.html
@@ -0,0 +1,38 @@
+{%extends "base.html"%}
+
+{%block title%}gn-auth: Forgot Password{%endblock%}
+
+{%block pagetitle%}Forgot Password{%endblock%}
+
+{%block content%}
+{{flash_messages()}}
+
+<div class="container-fluid">
+ <div class="row"><h1>Forgot Password</h1></div>
+
+ <div class="row">
+ <form method="POST"
+ action="{{url_for('oauth2.users.forgot_password',
+ client_id=client_id,
+ redirect_uri=redirect_uri,
+ response_type=response_type)}}">
+ <div class="form-group">
+ <span>
+ Provide you email below, and we will send you a link you can use to
+ change your password.
+ </span>
+ </div>
+
+ <div class="form-group">
+ <label for="txt-email" class="form-label">Email</label>
+ <input type="email" name="email" id="txt-email" class="form-control" />
+ </div>
+
+ <div class="form-group">
+ <input type="submit" class="btn btn-primary" value="Send Link" />
+ </div>
+ </form>
+ </div>
+
+</div>
+{%endblock%}