Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion anchor/server/api/signup.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ internals.applyRoutes = function (server, next) {
Joi.validate(request.payload.password, new PasswordComplexity(complexityOptions), (err, value) => {

if (err) {
return reply(Boom.conflict('Password does not meet complexity standards'));
return reply(Boom.conflict('Your password must have at least 8 characters, 1 lowercase letter, 1 uppercase letter, 1 numeric character, and 1 symbol.'));
}
reply(true);
});
Expand Down
21 changes: 12 additions & 9 deletions anchor/server/api/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ internals.applyRoutes = function (server, next) {
path: '/table/users',
config: {
auth: {
strategies: ['simple', 'jwt', 'session']
strategies: ['simple', 'jwt', 'session'],
scope: ['root','clinician', 'analyst', 'admin']
},
validate: {
query: Joi.any()
Expand Down Expand Up @@ -56,8 +57,8 @@ internals.applyRoutes = function (server, next) {
}
query.inStudy = true;
}
//clinician
else if (accessLevel === 2) {
//clinician or root
else if (accessLevel === 2 || accessLevel === 3) {

const userAccess = JSON.parse(request.auth.credentials.user.roles.clinician.userAccess);
const patientsObjectIds = [];
Expand All @@ -70,7 +71,7 @@ internals.applyRoutes = function (server, next) {
_id: { $in: patientsObjectIds }
};

//this is the global query object
//this is the global query object
query = filter;
}

Expand Down Expand Up @@ -226,7 +227,7 @@ internals.applyRoutes = function (server, next) {
config: {
auth: {
strategies: ['simple', 'jwt', 'session'],
scope: 'admin'
scope: ['root','admin']
}
},
handler: function (request, reply) {
Expand All @@ -247,6 +248,7 @@ internals.applyRoutes = function (server, next) {
});



server.route({
method: 'GET',
path: '/users/my',
Expand Down Expand Up @@ -338,7 +340,7 @@ internals.applyRoutes = function (server, next) {
Joi.validate(request.payload.password, new PasswordComplexity(complexityOptions), (err, value) => {

if (err) {
return reply(Boom.conflict('Password does not meet complexity standards'));
return reply(Boom.conflict('Your password must have at least 8 characters, 1 lowercase letter, 1 uppercase letter, 1 numeric character, and 1 symbol.'));
}
reply(true);
});
Expand Down Expand Up @@ -394,11 +396,12 @@ internals.applyRoutes = function (server, next) {
config: {
auth: {
strategies: ['simple', 'jwt', 'session'],
scope: 'admin'
scope: ['admin', 'root']
},
validate: {
params: {
id: Joi.string().invalid('000000000000000000000000')
id: Joi.string()
// .invalid('000000000000000000000000')
},
payload: {
username: Joi.string().token().lowercase().required(),
Expand Down Expand Up @@ -745,7 +748,7 @@ internals.applyRoutes = function (server, next) {
Joi.validate(request.payload.password, new PasswordComplexity(complexityOptions), (err, value) => {

if (err) {
return reply(Boom.conflict('Password does not meet complexity standards'));
return reply(Boom.conflict('Your password must have at least 8 characters, 1 lowercase letter, 1 uppercase letter, 1 numeric character, and 1 symbol.'));
}
reply(true);
});
Expand Down
2 changes: 1 addition & 1 deletion anchor/server/web/partials/nav.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<a class="nav-link" href="login" style="color:white;">LOGIN</a>
</li>
<li class="nav-item">
<a class="nav-link" href="signup" style="color:white;">SIGNUP</a>
<a class="nav-link" href="signup" style="color:white;">SIGN UP</a>
</li>
</ul>
{{/if}}
Expand Down
2 changes: 1 addition & 1 deletion anchor/server/web/partials/notification.handlebars
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="alert" role="alert" id="alert" style="position: fixed;
top: 7.5%;
left: 10%;
height: 50px;
/* height: 50px; */
width: 80%;
z-index: 999999">
<button type="button" class="close" aria-label="Close" onclick="$('#alert').hide()">
Expand Down
30 changes: 30 additions & 0 deletions anchor/server/web/public/css/createUser.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.complexity {
margin-top: -700px;
/* margin-left: 30px; */
font-size: 20px;
color: black;
position: relative;
}

.form-group{
padding-bottom: 10px;
}

hr {
margin-bottom: 3rem;
}

label {
/* padding: 15px; */
/* margin-left: 0px */
}

.card {
padding-left: 30px;
padding-right: 30px;
/* padding-top: 30px; */
}

body > div.container-fluid.h-100 > div > nav{
height: 130%;
}
27 changes: 27 additions & 0 deletions anchor/server/web/public/css/signup.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
.card-title {
margin-bottom: 10px;
} */


.complexity {
margin-top: -620px;
margin-left: 23px;
font-size: 18px;
color: #3e8acc;
position: relative

}

hr {
margin-bottom: 5em;
}

/* .form-group{
padding-bottom: 20px;
} */

/* label {
padding: 20px;
margin-left: -20px
} */
3 changes: 3 additions & 0 deletions anchor/server/web/public/css/users.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body > div.container-fluid.h-100 > div > nav{
height: 170%;
}
10 changes: 0 additions & 10 deletions anchor/server/web/public/scripts/exercise/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ const schema = Joi.object({

joiToForm('formFields', schema);

// $('#update').click((event) => {
// const exerciseId = window.location.pathname.split('/').pop();
// event.preventDefault();
// const values = {};
// $.each($('#form').serializeArray(), (i, field) => {
// values[field.name] = field.value;
// });

$('#update').click((event) => {
const exerciseId = window.location.pathname.split('/').pop();
event.preventDefault();
Expand All @@ -37,5 +29,3 @@ $('#update').click((event) => {
}
});
});


4 changes: 2 additions & 2 deletions anchor/server/web/public/scripts/users/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const schema = Joi.object({
name: Joi.string().required(),
email: Joi.string().email().lowercase().required(),
username: Joi.string().token().lowercase().invalid('root').required(),
password: Joi.string().required().min(8).regex(/^[A-Z]+[a-z]+[0-9]+$/, '1 Uppercase, 1 lowercase, 1 number'),
confirmPassword: Joi.string().required().min(8).regex(/^[A-Z]+[a-z]+[0-9]+$/, '1 Uppercase, 1 lowercase, 1 number')
password: Joi.string().required(),
confirmPassword: Joi.string().required()
});
joiToForm('formFields',schema);

Expand Down
8 changes: 4 additions & 4 deletions anchor/server/web/templates/signup/signup.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
<div class="col-xl-6 col-lg-6">
<div class="card">
<div class="card-body">
<h4 class="card-title">Signup</h4>
<h4 class="card-title">Sign Up</h4>
<hr>
<form id="signupForm">
<div id="signUpFormFields"></div>
<button id="signup" type="submit" class="btn btn-primary">Sign Up</button>
</form>
</div>
</div>
<div class="complexity">*Password must include 8-20 characters, 1 lowercase, 1 uppercase, and 1 special character*</div>
</div>
</div>
</div>
Expand All @@ -18,7 +20,5 @@
background-color: #bbb;
}
</style>
<script>

</script>
<script type="text/javascript" src="public/scripts/signup.js"></script>
<link rel="stylesheet" type="text/css" href="public/css/signup.css">
4 changes: 3 additions & 1 deletion anchor/server/web/templates/users/create.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
<h3>Create User</h3>
<hr>
<div class="card">
<div style="padding: 20px">
<div style="padding-top: 30px; padding-bottom: 30px">
<form id="form">
<div id="formFields"></div>
<button id="create" type="submit" class="btn btn-primary">Create</button>
</form>
</div>
</div>
<div class="complexity">*Password must include 8-20 characters, 1 lowercase, 1 uppercase, and 1 special character*</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="public/scripts/users/create.js"></script>
<link rel= stylesheet type="text/css" href="public/css/createUser.css">
1 change: 1 addition & 0 deletions anchor/server/web/templates/users/index.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,4 @@
});
</script>
<script type="text/javascript" src="public/scripts/users/index.js"></script>
<link rel= stylesheet type="text/css" href="public/css/users.css">