var OhmHello={init:function(){hello.init({google:"4363662406-njm489qj7j2q4j8n2oo2cs36qm1dsucb.apps.googleusercontent.com"},{redirect_uri:'https://login.ohmconnect.com/auth/hello',scope:'email'});$('[data-ohm-selector=login-google]').click(function(event){event.preventDefault();OhmHello.login_via_google(true);});$('[data-ohm-selector=signup-google]').click(function(event){event.preventDefault();OhmHello.login_via_google(false);});},login_via_google:function(login){hello('google').login({force:false,scope:'email'}).then(function(){OhmHello.fetch_google(login);});},fetch_google:function(login){var self=this;hello('google').api('me').then(function(r){var data=hello('google').getAuthResponse();r.access_token=data.access_token;$.post('https://login.ohmconnect.com/auth/hello?login='+login,r,function(data){if(data.success==1){window.location=data.redirect;} else if(typeof data.msg!="undefined"){self.notify(data.msg);} else{self.notify("Unknown authentication error #2");}});});},notify:function(msg){if(typeof(clickToDismiss)=="function"){clickToDismiss(msg);}else{alert(msg);}}};OhmHello.init();