Tidied up login page/navbar.
This commit is contained in:
parent
478edeeddf
commit
3eddd0ea5b
5 changed files with 21 additions and 2 deletions
|
|
@ -29,6 +29,12 @@ module.exports.get = async function(req, res){
|
|||
//Check for validation errors
|
||||
const validResult = validationResult(req);
|
||||
|
||||
//If this request is coming from someone who's already logged in
|
||||
if(req.session.user != null){
|
||||
//Redirect them to the homepage
|
||||
return res.redirect('/');
|
||||
}
|
||||
|
||||
//If there are none
|
||||
if(validResult.isEmpty()){
|
||||
//Get username from sanatized/validated data
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.-->
|
|||
</head>
|
||||
<body>
|
||||
<%- include('partial/navbar', {user}); %>
|
||||
<h2>User Login</h2>
|
||||
<% if(challenge != null){ %>
|
||||
<h3 class="danger-text">Multiple failed attempts detected!</h3>
|
||||
<p class="danger-text">Please complete verification challenge to continue!</p>
|
||||
|
|
@ -36,6 +37,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.-->
|
|||
<% if(challenge != null){ %>
|
||||
<altcha-widget challengejson="<%= JSON.stringify(challenge) %>"></altcha-widget>
|
||||
<% } %>
|
||||
<a href="/register">Create New Account</a>
|
||||
<a href="/passwordReset">Forgot Password</a>
|
||||
<button id="login-page-button" class='positive-button'>Login</button>
|
||||
</form>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.-->
|
|||
<% }else{ %>
|
||||
<input class="navbar-item login-prompt" id="username-prompt" placeholder="username">
|
||||
<input class="navbar-item login-prompt" id="password-prompt" placeholder="password" type="password">
|
||||
<p class="navbar-item"><a class="navbar-item" href="javascript:" id="login-button">Login</a> - <a class="navbar-item" href="/register">Register</a></p>
|
||||
<p class="navbar-item"><a class="navbar-item" href="javascript:" id="login-button">Login</a> - <a class="navbar-item" href="/passwordReset">Forgot Password</a> - <a class="navbar-item" href="/register">Register</a></p>
|
||||
<% } %>
|
||||
</span>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue