This commit is contained in:
Your Name committed 2026-06-08 06:17:50 +07:00
1 parent 6cfe39b1ff
commit c1c3a43d7d
8 files changed
+21 -6

No files matched your search

+2 -4
View File
@@ -13,8 +13,7 @@ export const initLiff = async (liffId: string) => {
await authenticateWithBackend(profile);
} else if (liff.isInClient()) {
// เปิดเว็บผ่านเบราว์เซอร์ของ LINE (In-App Browser) แต่ยังไม่ได้ล็อกอิน
// ส่ง redirectUri: window.location.href เพื่อให้หลัง login แล้วกลับมาที่หน้าเดิม
liff.login({ redirectUri: window.location.href });
liff.login();
}
} catch (error) {
console.error("LIFF Initialization failed", error);
@@ -50,8 +49,7 @@ const authenticateWithBackend = async (profile: any) => {
export const loginLiff = () => {
if (!liff.isLoggedIn()) {
// ส่ง redirectUri เพื่อกลับมาที่หน้าเดิมหลัง login
liff.login({ redirectUri: window.location.href });
liff.login();
}
};