Subversion Repositories SmartDukaan

Rev

Rev 22095 | Rev 22245 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22095 Rev 22139
Line 1... Line 1...
1
var googleProfile;
1
var googleProfile;
2
 
2
 
-
 
3
 
-
 
4
$(document).ajaxComplete(
-
 
5
	function(){
-
 
6
		
-
 
7
	}
-
 
8
);
3
var startApp = function() {
9
var startApp = function() {
4
  gapi.load('auth2', function(){
10
  gapi.load('auth2', function(){
5
    // Retrieve the singleton for the GoogleAuth library and set up the client.
11
    // Retrieve the singleton for the GoogleAuth library and set up the client.
6
    auth2 = gapi.auth2.init({
12
    auth2 = gapi.auth2.init({
7
      client_id: googleApiKey,
13
      client_id: googleApiKey,
Line 27... Line 33...
27
 
33
 
28
function submitUser(googleUser){
34
function submitUser(googleUser){
29
	jQuery.ajax({
35
	jQuery.ajax({
30
        type : "POST",
36
        type : "POST",
31
        url : context+"/login",
37
        url : context+"/login",
-
 
38
        dataType: 'json',
32
        data: {"token":googleUser.getAuthResponse().id_token},
39
        data: {"token":googleUser.getAuthResponse().id_token},
33
        success: function(data, textStatus, request){
40
        success: function(data, textStatus, request){
34
        	console.log(data);
41
        	console.log(data);
35
        	addProfileInLocalDb();
42
        	addProfileInLocalDb();
36
        	window.location.href= context+"/dashboard";
43
        	window.location.href= data.redirectUrl;
37
   		}
44
   		}
38
    });  
45
    });  
39
}
46
}
40
 
47
 
41
function addProfileInLocalDb(){
48
function addProfileInLocalDb(){