frontend/app/utils/auth.ts

17 lines
530 B
TypeScript
Raw Permalink Normal View History

import { confirmModalService } from "~/components/modals/composable";
2025-07-16 07:48:39 +02:00
import * as m from "~~/paraglide/messages.js";
export const askForInstance = async (): Promise<URL> => {
const { confirmed, value } = await confirmModalService.confirm({
title: m.sharp_alive_anteater_fade(),
inputType: "url",
message: m.noble_misty_rook_slide(),
});
if (confirmed && value) {
return new URL(URL.canParse(value) ? value : `https://${value}`);
}
throw new Error("No instance provided");
};