mirror of
http://github.com/valkey-io/valkey
synced 2024-11-22 00:52:38 +00:00
Module API: Fail ineffective auth calls.
The client pointed to by the module context may in some cases be a fake client. RM_Authenticate*() calls in this case would be ineffective but appear to succeed, and this change fails them to make it easier to catch such cases.
This commit is contained in:
parent
1591e3479d
commit
cfccfbd6f4
@ -5639,6 +5639,11 @@ static int authenticateClientWithUser(RedisModuleCtx *ctx, user *user, RedisModu
|
||||
return REDISMODULE_ERR;
|
||||
}
|
||||
|
||||
/* Avoid settings which are meaningless and will be lost */
|
||||
if (!ctx->client || (ctx->client->flags & CLIENT_MODULE)) {
|
||||
return REDISMODULE_ERR;
|
||||
}
|
||||
|
||||
moduleNotifyUserChanged(ctx->client);
|
||||
|
||||
ctx->client->user = user;
|
||||
|
Loading…
Reference in New Issue
Block a user