Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
18 changes: 10 additions & 8 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,7 +396,7 @@ internals.applyRoutes = function (server, next) {
config: {
auth: {
strategies: ['simple', 'jwt', 'session'],
scope: 'admin'
scope: ['admin', 'root']
},
validate: {
params: {
Expand Down Expand Up @@ -745,7 +747,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
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) => {
}
});
});


2 changes: 1 addition & 1 deletion anchor/server/web/templates/signup/signup.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<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>
<form id="signupForm">
<div id="signUpFormFields"></div>
<button id="signup" type="submit" class="btn btn-primary">Sign Up</button>
Expand Down