fix token create

This commit is contained in:
xiaomlove
2025-06-22 20:43:04 +07:00
parent fe6977cb93
commit 83cab0da09
2 changed files with 4 additions and 10 deletions

View File

@@ -30,7 +30,7 @@ class TokenController extends Controller
}
$allowed = TokenRepository::listUserTokenPermissionAllowed();
foreach ($request->permissions as $permission) {
if (!in_array($permission, $allowed)) {
if (!isset($allowed[$permission])) {
throw new NexusException(nexus_trans("token.permission_not_allowed", ['permission_text' => nexus_trans("route-permission.{$permission}.text")]));
}
}