summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/web/views/oauth.tsx
blob: d12b0d15fdbbfed996201019084caf360daa5c52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * SPDX-FileCopyrightText: syuilo and misskey-project
 * SPDX-License-Identifier: AGPL-3.0-only
 */

import type { CommonProps } from '@/server/web/views/_.js';
import { Layout } from '@/server/web/views/base.js';

export function OAuthPage(props: CommonProps<{
	transactionId: string;
	clientName: string;
	clientLogo?: string;
	scope: string[];
}>) {

	//- Should be removed by the page when it loads, so that it won't needlessly
	//- stay when user navigates away via the navigation bar
	//- XXX: Remove navigation bar in auth page?
	function metaBlock() {
		return (
			<>
				<meta name="misskey:oauth:transaction-id" content={props.transactionId} />
				<meta name="misskey:oauth:client-name" content={props.clientName} />
				{props.clientLogo ? <meta name="misskey:oauth:client-logo" content={props.clientLogo} /> : null}
				<meta name="misskey:oauth:scope" content={props.scope.join(' ')} />
			</>
		);
	}

	return (
		<Layout
			{...props}
			metaSlot={metaBlock()}
		>
		</Layout>
	);
}