Skip to content

Instantly share code, notes, and snippets.

@sirateek
Last active May 13, 2020 14:47
Show Gist options
  • Save sirateek/9805891f90becbe044fb5f405a41d3fd to your computer and use it in GitHub Desktop.
Save sirateek/9805891f90becbe044fb5f405a41d3fd to your computer and use it in GitHub Desktop.
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