I have the following code for the url, if url have invited_by then show signup popup on the provided page in the link like this http://streamkar.dev/store/?invited_by=1 , Its basically to show the signup popup.
$(document).ready(function(){
var a = window.location.href.toString();
var b = a.split("invited_by=");
if(typeof b[1] !=="undefined"){
console.log(b[1]);
$("#login-modal").modal('show');
$(".signin").click();
}
});
What i want is that how can we check user Authentication, That if a user is already logged in then :
Show :
http://streamkar.dev/store
Instead of :
http://streamkar.dev/store/?invited_by=1
Basically The invitation link can be given to someone, If he/she is already logged in then just show the page, If not then show the popup for signup then redirect to the page in the url, Its basically invitation.
How can i achieve that, I am not coming up with some suitable logic.