Pull out libusers

This commit is contained in:
2026-06-17 17:34:07 +02:00
parent 8aab365e14
commit 05f318233b
5 changed files with 46 additions and 30 deletions

View File

@@ -1,14 +1,13 @@
#include <microhttpd.h>
#include <sha256.h>
#include <uuid/uuid.h>
#include <dirent.h>
#include "path.h"
#include "users.h"
#include "noh.h"
Noh_Arena temp;
#include "users.c"
#define SV Noh_String_View
#define sv noh_sv_from_cstr
@@ -67,7 +66,7 @@ static bool authorize_user(struct MHD_Connection *connection, SV *username, Sett
}
// Hash the provided password.
hashed = hash_password(provided_username, provided_password);
hashed = hash_password(&temp, provided_username, provided_password);
// Check the hash.
if (!noh_sv_eq(noh_sv_from_string(hashed), user->hash)) {