Update example usage

This commit is contained in:
xfarrow
2023-10-19 17:54:02 +02:00
parent 9c880af4d8
commit 533b223c8b
4 changed files with 4 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -18,8 +18,7 @@ require('dotenv').config();
const app = express();
app.use(express.json()); // Middleware which parses JSON for POST requests
// Enable CORS for all routes
app.use(cors());
app.use(cors()); // Enable CORS for all routes
app.post('/blinkapi/register', api_controller.registerPerson); // Register a Person
app.post('/blinkapi/login', api_controller.login); // Login
app.get('/blinkapi/person/:id', api_controller.verifyToken, api_controller.getPerson); // Obtain Person's details

View File

@ -242,12 +242,12 @@ async function deleteOrganization(req, res){
try {
// Here we do not actually need a transaction. Two different queries,
// one who checks if the user is admin and one to add the user would've
// one who checks if the user is admin and one to delete the organization would've
// been sufficient and non-exploitable, but still it'd have been a
// TOC/TOU weakness (https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use).
// Whether a good practice or not is matter of debate.
// There are other points in the code using the same technique to address the same
// problematic
// problem
knex.transaction(async (trx) => {
// Check if the current user is a organization's administrator
const isOrganizationAdmin = await trx('OrganizationAdministrator')

View File

@ -3,7 +3,6 @@
<head>
<meta charset="UTF-8">
<title>Sign Up to Blink</title>
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> -->
<link rel="stylesheet" href="../css/login-register.css">
<script src=""></script>
</head>