diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2024-10-21 12:49:29 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-21 12:49:29 +0900 |
| commit | 5c79d8db208da1fd7c5bc4900090c3d7b9512196 (patch) | |
| tree | 0be695300f396721e472543052d6fcdfb8a2e636 /packages/backend/src/server/web | |
| parent | fix(frontend): Captcha のエラーハンドリング (#14811) (diff) | |
| download | sharkey-5c79d8db208da1fd7c5bc4900090c3d7b9512196.tar.gz sharkey-5c79d8db208da1fd7c5bc4900090c3d7b9512196.tar.bz2 sharkey-5c79d8db208da1fd7c5bc4900090c3d7b9512196.zip | |
feat: ノートの閲覧にログイン必須にする設定 (#14799)
* wip
* wip
* wip
* Update packages/frontend/src/pages/note.vue
Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
* wip
* Update WebhookTestService.ts
* Update privacy.vue
* wip
* rename
* Update locales/ja-JP.yml
Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com>
* :art:
* wip
---------
Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com>
Diffstat (limited to 'packages/backend/src/server/web')
| -rw-r--r-- | packages/backend/src/server/web/ClientServerService.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/packages/backend/src/server/web/ClientServerService.ts b/packages/backend/src/server/web/ClientServerService.ts index c9c29e42a8..4860ef3e12 100644 --- a/packages/backend/src/server/web/ClientServerService.ts +++ b/packages/backend/src/server/web/ClientServerService.ts @@ -601,12 +601,15 @@ export class ClientServerService { fastify.get<{ Params: { note: string; } }>('/notes/:note', async (request, reply) => { vary(reply.raw, 'Accept'); - const note = await this.notesRepository.findOneBy({ - id: request.params.note, - visibility: In(['public', 'home']), + const note = await this.notesRepository.findOne({ + where: { + id: request.params.note, + visibility: In(['public', 'home']), + }, + relations: ['user'], }); - if (note) { + if (note && !note.user!.requireSigninToViewContents) { const _note = await this.noteEntityService.pack(note); const profile = await this.userProfilesRepository.findOneByOrFail({ userId: note.userId }); reply.header('Cache-Control', 'public, max-age=15'); |