add initial findings
This commit is contained in:
28
c2015/login/protectedHandler.js
Normal file
28
c2015/login/protectedHandler.js
Normal file
@@ -0,0 +1,28 @@
|
||||
var email, sessionKey, sessionVal;
|
||||
function onSignIn(googleUser){
|
||||
var profile = googleUser.getBasicProfile();
|
||||
email = profile.email;
|
||||
//
|
||||
sessionKey = email;
|
||||
sessionVal = localStorage.getItem(sessionKey);
|
||||
}
|
||||
|
||||
function doAuthCheck(){
|
||||
if (sessionVal != "in") {
|
||||
alert("authError!");
|
||||
} else {alert("auth successful")}
|
||||
}
|
||||
|
||||
$(window).load(function ()
|
||||
{
|
||||
var i = setInterval(function ()
|
||||
{
|
||||
if ($('#foo').length)
|
||||
{
|
||||
clearInterval(i);
|
||||
// safe to execute your code here
|
||||
doAuthCheck();
|
||||
|
||||
}
|
||||
}, 2000);
|
||||
});
|
||||
Reference in New Issue
Block a user