feat: новая функция
This commit is contained in:
@@ -244,8 +244,9 @@ class EmailAuth {
|
||||
const linkedWallet = await authService.getLinkedWallet(finalUserId);
|
||||
if (linkedWallet) {
|
||||
logger.info(`[checkEmailVerification] Found linked wallet ${linkedWallet} for user ${finalUserId}. Checking admin role...`);
|
||||
const isAdmin = await checkAdminRole(linkedWallet);
|
||||
userRole = isAdmin ? 'admin' : 'user';
|
||||
const authService = require('./auth-service');
|
||||
const userAccessLevel = await authService.getUserAccessLevel(linkedWallet);
|
||||
userRole = userAccessLevel.hasAccess ? 'admin' : 'user';
|
||||
logger.info(`[checkEmailVerification] Role for user ${finalUserId} determined as: ${userRole}`);
|
||||
|
||||
// Опционально: Обновить роль в таблице users, если она отличается
|
||||
|
||||
Reference in New Issue
Block a user