summaryrefslogtreecommitdiff
path: root/packages/frontend/src/scripts/login-id.ts
blob: fe0e17e66ea806285a32a3963006e460e992c149 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 * SPDX-FileCopyrightText: syuilo and other misskey contributors
 * SPDX-License-Identifier: AGPL-3.0-only
 */

export function getUrlWithLoginId(url: string, loginId: string) {
	const u = new URL(url, origin);
	u.searchParams.append('loginId', loginId);
	return u.toString();
}

export function getUrlWithoutLoginId(url: string) {
	const u = new URL(url);
	u.searchParams.delete('loginId');
	return u.toString();
}