Repository: appwrite/appwrite
File: app/controllers/api/projects.php (PHP)

Code before:
            throw new Exception(Exception::PROJECT_NOT_FOUND);
        }

        $templates = $project->getAttribute('templates', []);
        $template  = $templates['email.' . $type . '-' . $locale] ?? null;

        if (is_null($template)) {
            throw new Exception(Exception::PROJECT_TEMPLATE_DEFAULT_DELETION);
        }

        unset($templates['email.' . $type . '-' . $locale]);

        $project = $dbForPlatform->updateDocument('projects', $project->getId(), $project->setAttribute('templates', $templates));

        $response->dynamic(new Document([
            'type' => $type,
            'locale' => $locale,
            'senderName' => $template['senderName'],
            'senderEmail' => $template['senderEmail'],
            'subject' => $template['subject'],
            'replyTo' => $template['replyTo'],
            'message' => $template['message']
        ]), Response::MODEL_EMAIL_TEMPLATE);
    });

App::patch('/v1/projects/:projectId/auth/password-change')
->desc('Update on password change of the project')
->groups(['api', 'projects'])
->label('scope', 'projects.write')
->label('sdk', new Method(
    namespace: 'projects',
    group: 'auth',
    name: 'updateOnPasswordChange',
    description: '/docs/references/projects/update-auth-on-password-change.md',
    auth: [AuthType::ADMIN],
    responses: [
        new SDKResponse(
            code: Response::STATUS_CODE_OK,
            model: Response::MODEL_PROJECT,
        )
    ]
))
->param('projectId', '', new UID(), 'Project unique ID.')
->param('onPasswordChange', false, new Boolean(), 'Auth option to allow invalidating existing sessions')
->inject('response')
->inject('dbForPlatform')
->action(function (string $projectId, bool $onPasswordChange, Response $response, Database $dbForPlatform) {

    $project = $dbForPlatform->getDocument('projects', $projectId);

    if ($project->isEmpty()) {

Review comment (security):
Let's update all the desc, method name, etc to match the path change:

```suggestion
App::patch('/v1/projects/:projectId/auth/session-invalidation')
```

Code after:
        }

        $templates = $project->getAttribute('templates', []);
        $template  = $templates['email.' . $type . '-' . $locale] ?? null;

        if (is_null($template)) {
            throw new Exception(Exception::PROJECT_TEMPLATE_DEFAULT_DELETION);
        }

        unset($templates['email.' . $type . '-' . $locale]);

        $project = $dbForPlatform->updateDocument('projects', $project->getId(), $project->setAttribute('templates', $templates));

        $response->dynamic(new Document([
            'type' => $type,
            'locale' => $locale,
            'senderName' => $template['senderName'],
            'senderEmail' => $template['senderEmail'],
            'subject' => $template['subject'],
            'replyTo' => $template['replyTo'],
            'message' => $template['message']
        ]), Response::MODEL_EMAIL_TEMPLATE);
    });

App::patch('/v1/projects/:projectId/auth/session-invalidation')
    ->desc('Update invalidate session option of the project')
    ->groups(['api', 'projects'])
    ->label('scope', 'projects.write')
    ->label('sdk', new Method(
        namespace: 'projects',
        group: 'auth',
        name: 'updateSessionInvalidation',
        description: '/docs/references/projects/update-session-invalidation.md',
        auth: [AuthType::ADMIN],
        responses: [
            new SDKResponse(
                code: Response::STATUS_CODE_OK,
                model: Response::MODEL_PROJECT,
            )
        ]
    ))
    ->param('projectId', '', new UID(), 'Project unique ID.')
    ->param('enabled', false, new Boolean(), 'Update authentication session invalidation status. Use this endpoint to enable or disable session invalidation on password change')
    ->inject('response')
    ->inject('dbForPlatform')
    ->action(function (string $projectId, bool $invalidateSessions, Response $response, Database $dbForPlatform) {

        $project = $dbForPlatform->getDocument('projects', $projectId);

        if ($project->isEmpty()) {
            throw new Exception(Exception::PROJECT_NOT_FOUND);