Add global scope to fix invalid routes getting 401 instead of 404
This commit is contained in:
parent
a1d62d8d42
commit
b58c34a052
2 changed files with 5 additions and 3 deletions
|
@ -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'],
|
||||
],
|
||||
];
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue