1
0
Fork 0
mirror of synced 2024-10-01 17:58:02 +13:00

Add global scope to fix invalid routes getting 401 instead of 404

This commit is contained in:
Jake Barnby 2023-08-22 22:42:04 -04:00
parent a1d62d8d42
commit b58c34a052
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C
2 changed files with 5 additions and 3 deletions

View file

@ -3,6 +3,7 @@
use Appwrite\Auth\Auth;
$member = [
'global',
'public',
'home',
'console',
@ -23,6 +24,7 @@ $member = [
];
$admins = [
'global',
'graphql',
'teams.read',
'teams.write',
@ -92,6 +94,6 @@ return [
],
Auth::USER_ROLE_APPS => [
'label' => 'Applications',
'scopes' => ['public', 'health.read', 'graphql'],
'scopes' => ['global', 'health.read', 'graphql'],
],
];

View file

@ -374,7 +374,7 @@ App::init()
: Role::users()->toString();
// Add user roles
$memberships = $user->find('teamId', $project->getAttribute('teamId', null), 'memberships');
$memberships = $user->find('teamId', $project->getAttribute('teamId'), 'memberships');
if ($memberships) {
foreach ($memberships->getAttribute('roles', []) as $memberRole) {
@ -763,7 +763,7 @@ include_once __DIR__ . '/shared/api/auth.php';
App::wildcard()
->groups(['api'])
->label('scope', 'public')
->label('scope', 'global')
->action(function () {
throw new AppwriteException(AppwriteException::GENERAL_ROUTE_NOT_FOUND);
});