function initAuthMethods()

in vscode/qodana/src/extension.ts [143:188]


function initAuthMethods(context: vscode.ExtensionContext) {
	if (!context) {
		return;
	}
	context.subscriptions.push(
		vscode.commands.registerCommand(COMMAND_LOG_IN, async () => {
			extensionInstance.auth?.logIn();
		})
	);
	context.subscriptions.push(
		vscode.commands.registerCommand(COMMAND_LOG_IN_CUSTOM_SERVER, async () => {
			const userInput = await vscode.window.showInputBox({
				prompt: SELF_HOSTED_TOOLTIP
			});
			if (userInput !== undefined) {
				extensionInstance.auth?.logIn(userInput);
			}
			// todo handle error
		})
	);

	context.subscriptions.push(
		vscode.commands.registerCommand(COMMAND_LOG_OUT, async () => {
			// noinspection ES6MissingAwait
			extensionInstance.closeReport();
			await extensionInstance.auth?.logOut();
		})
	);

	context.subscriptions.push(
		vscode.commands.registerCommand(COMMAND_CANCEL_AUTHORIZATION, async () => {
			extensionInstance.auth?.cancelAuthorization();
		})
	);

	const loginView = new LogInView(context);
	context.subscriptions.push(
		vscode.window.registerWebviewViewProvider(LogInView.viewType, loginView)
	);


	const settingsView = new SettingsView(context);
	context.subscriptions.push(
		vscode.window.registerWebviewViewProvider(SettingsView.viewType, settingsView)
	);
}