Skip to content

Commit

Permalink
Merge branch 'agorafoundation:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Udassi-Pawan authored Jan 5, 2024
2 parents 397b72d + fdd4a0a commit 7e63493
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2021-2023, Brian Gormanly
Copyright (c) 2021-2024, Brian Gormanly
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
10 changes: 10 additions & 0 deletions client/agora/public/css/agora-theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -2215,4 +2215,14 @@ input:checked+.slider:after {
/* Form stuff */
.form-control-lg {
margin-bottom: 10px;
}
/* CSS Class for Honeypot Field */
.address-field {
opacity: 0;
position: absolute;
top: 0;
left: 0;
height: 0;
width: 0;
z-index: -1;
}
1 change: 1 addition & 0 deletions client/agora/views/user-signup.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
<div class="form-group">
<h5>To get started we need your email and name</h5>
<small id="emailHelp" class="form-text text-muted">We'll never share your information with anyone else.</small>
<input type="text" class="address-field" name="userAddress" placeholder="Enter Your Address" tabindex="-1" autocomplete="off">
<input type="email" class="form-control form-control-lg" name="userEmail" id="userEmail" aria-describedby="emailHelp" placeholder="Enter email" required>
<small id="usernameHelp" class="form-text text-muted">Username must be unique</small>
<input type="input" class="form-control form-control-lg" name="userUsername" id="userUsername" aria-describedby="usernameHelp" placeholder="Enter Username" required>
Expand Down
7 changes: 6 additions & 1 deletion server/controller/userController.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ exports.createUserForm = async function( req, res ) {
res.setHeader( 'Content-Type', 'text/html' );

if( req && req.body ) {
if( req.body.userEmail ) {
// If there is anything in honeypotField, just return error
let honeypotField = req.body.userAddress;
if( honeypotField ){
res.render( 'user-signup', {error_message: "Error signing up!"} );
}
else if( req.body.userEmail ) {

// create model
let email = req.body.userEmail;
Expand Down

0 comments on commit 7e63493

Please sign in to comment.