#ifndef BOKF_AUTH_H #define BOKF_AUTH_H #include #include #define AUTH_TOKEN_PREFIX "bokf_" int auth_hash_password(const char *pw, char **out_phc); int auth_verify_password(const char *phc, const char *pw); void auth_hash_token(const char *token, unsigned char out[32]); char *auth_generate_token(void); /* Returns user id > 0, -1 if not found, -2 on database error. */ int64_t auth_user_lookup(sqlite3 *db, const char *username, char **out_pwhash, char **out_display, int *out_is_admin, int *out_disabled); #endif