mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
fix: jwt auth database selection for admin mode
Use dbForPlatform for JWT user lookup in admin mode
This commit is contained in:
@@ -264,7 +264,11 @@ App::setResource('user', function ($mode, $project, $console, $request, $respons
|
||||
|
||||
$jwtUserId = $payload['userId'] ?? '';
|
||||
if (!empty($jwtUserId)) {
|
||||
$user = $dbForProject->getDocument('users', $jwtUserId);
|
||||
if (APP_MODE_ADMIN !== $mode) {
|
||||
$user = $dbForProject->getDocument('users', $jwtUserId);
|
||||
} else {
|
||||
$user = $dbForPlatform->getDocument('users', $jwtUserId);
|
||||
}
|
||||
}
|
||||
|
||||
$jwtSessionId = $payload['sessionId'] ?? '';
|
||||
|
||||
Reference in New Issue
Block a user