feat(profile): show messenger connect success state

This commit is contained in:
Ruslan Bakiev
2026-04-03 18:25:21 +07:00
parent 6cadd5160c
commit f2fb64a0b7
4 changed files with 61 additions and 1 deletions

View File

@@ -13,12 +13,13 @@ type MessengerStartInput = {
channel: MessengerChannel;
baseUrl: string;
email?: string;
redirectPath?: string;
};
export function useMessengerStart() {
const pendingChannel = ref<MessengerChannel | null>(null);
async function openMessengerBot({ channel, baseUrl, email }: MessengerStartInput) {
async function openMessengerBot({ channel, baseUrl, email, redirectPath }: MessengerStartInput) {
pendingChannel.value = channel;
const payloadPromise = $fetch<MessengerStartResponse>('/api/auth/messenger-start', {
@@ -26,6 +27,7 @@ export function useMessengerStart() {
body: {
channel,
email,
redirectPath,
},
});
payloadPromise.finally(() => {