Last active
May 13, 2020 14:47
-
-
Save sirateek/9805891f90becbe044fb5f405a41d3fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const queryString = decodeURIComponent(window.location.search) | |
.replace("?liff.state=", "") | |
.substr(1); | |
console.log(queryString); | |
liff.ready.then(() => { | |
if (!liff.isLoggedIn()) { | |
liff.login({ | |
redirectUri: | |
"https://tutorial.sirateek.me/LIFF/page2.html?" + queryString, | |
}); | |
} else { | |
console.log("Logged in"); | |
window.location.href = "page2.html?" + queryString; | |
} | |
}); | |
liff.init( | |
{ | |
liffId: "LIFF ID", | |
}, | |
() => {}, | |
(err) => { | |
console.log(err); | |
window.alert(err); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment