1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-16 07:10:07 +00:00

Validate repo_id when validate token from cache (#520)

This commit is contained in:
feiniks
2021-12-01 14:13:47 +08:00
committed by GitHub
parent ca63ba1269
commit ea2e328624

View File

@@ -303,7 +303,7 @@ validate_token (HttpServer *htp_server, evhtp_request_t *req,
pthread_mutex_lock (&htp_server->token_cache_lock);
token_info = g_hash_table_lookup (htp_server->token_cache, token);
if (token_info) {
if (token_info && strcmp (token_info->repo_id, repo_id) == 0) {
if (username)
*username = g_strdup(token_info->email);
pthread_mutex_unlock (&htp_server->token_cache_lock);