From 39526d0225a076398b40a6dd84f33265cb5903f3 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 2 Apr 2023 10:41:43 +0200 Subject: [PATCH] tmp --- .../backend/src/server/oauth/OAuth2ProviderService.ts | 5 ++--- packages/backend/src/server/web/views/oauth.pug | 1 - packages/frontend/src/components/MkButton.vue | 2 ++ packages/frontend/src/pages/oauth.vue | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/backend/src/server/oauth/OAuth2ProviderService.ts b/packages/backend/src/server/oauth/OAuth2ProviderService.ts index 2b9954fe55..afd06721a2 100644 --- a/packages/backend/src/server/oauth/OAuth2ProviderService.ts +++ b/packages/backend/src/server/oauth/OAuth2ProviderService.ts @@ -1,6 +1,5 @@ import dns from 'node:dns/promises'; import { Inject, Injectable } from '@nestjs/common'; -import Provider, { type Adapter, type Account, AdapterPayload } from 'oidc-provider'; import fastifyMiddie, { IncomingMessageExtended } from '@fastify/middie'; import { JSDOM } from 'jsdom'; import parseLinkHeader from 'parse-link-header'; @@ -429,8 +428,6 @@ export class OAuth2ProviderService { }); }); - // oidc-provider provides many more endpoints for OpenID support and there's - // no way to turn it off. // For now only allow the basic OAuth endpoints, to start small and evaluate // this feature for some time, given that this is security related. fastify.get<{ Querystring: OAuthRequestQuery }>('/oauth/authorize', async (request, reply) => { @@ -451,6 +448,8 @@ export class OAuth2ProviderService { reply.header('Cache-Control', 'no-store'); return await reply.view('oauth', { transactionId: oauth2?.transactionID, + clientId: oauth2?.client, + scope: oauth2?.req.scope.join(' '), }); }); fastify.post('/oauth/decision', async () => { }); diff --git a/packages/backend/src/server/web/views/oauth.pug b/packages/backend/src/server/web/views/oauth.pug index 717336f5e1..c4731b8114 100644 --- a/packages/backend/src/server/web/views/oauth.pug +++ b/packages/backend/src/server/web/views/oauth.pug @@ -7,4 +7,3 @@ block meta meta(name='misskey:oauth:transaction-id' content=transactionId) meta(name='misskey:oauth:client-id' content=clientId) meta(name='misskey:oauth:scope' content=scope) - meta(name='misskey:oauth:redirection-uri' content=redirectionUri) diff --git a/packages/frontend/src/components/MkButton.vue b/packages/frontend/src/components/MkButton.vue index e40b655fb7..38c79e89d0 100644 --- a/packages/frontend/src/components/MkButton.vue +++ b/packages/frontend/src/components/MkButton.vue @@ -5,6 +5,7 @@ :class="[$style.root, { [$style.inline]: inline, [$style.primary]: primary, [$style.gradate]: gradate, [$style.danger]: danger, [$style.rounded]: rounded, [$style.full]: full, [$style.small]: small, [$style.large]: large, [$style.transparent]: transparent, [$style.asLike]: asLike }]" :type="type" :name="name" + :value="value" @click="emit('click', $event)" @mousedown="onMousedown" > @@ -46,6 +47,7 @@ const props = defineProps<{ transparent?: boolean; asLike?: boolean; name?: string; + value?: string; }>(); const emit = defineEmits<{ diff --git a/packages/frontend/src/pages/oauth.vue b/packages/frontend/src/pages/oauth.vue index 29abef9893..77d64ef957 100644 --- a/packages/frontend/src/pages/oauth.vue +++ b/packages/frontend/src/pages/oauth.vue @@ -4,18 +4,18 @@
-

{{ $t('_auth.permission', { name }) }}

+

{{ i18n.t('_auth.permission', { name }) }}

{{ i18n.ts._auth.permissionAsk }}

    -
  • {{ $t(`_permissions.${p}`) }}
  • +
  • {{ i18n.t(`_permissions.${p}`) }}
-
{{ $t('_auth.shareAccess', { name }) }}
+
{{ i18n.t('_auth.shareAccess', { name }) }}
{{ i18n.ts._auth.shareAccessAsk }}
- {{ i18n.ts.cancel }} + {{ i18n.ts.cancel }} {{ i18n.ts.accept }}