Subversion Repositories SmartDukaan

Rev

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

Rev 1747 Rev 1776
Line 72... Line 72...
72
 
72
 
73
			if (email == null || password == null) {
73
			if (email == null || password == null) {
74
				return false;
74
				return false;
75
			}
75
			}
76
 
76
 
77
			String encryptedPassword =   desEncrypter.encrypt(password);
77
			String encryptedPassword = desEncrypter.encrypt(password);
78
			
78
			
79
			UserContextServiceClient userContextServiceClient = new UserContextServiceClient();
79
			UserContextServiceClient userContextServiceClient = new UserContextServiceClient();
80
			in.shop2020.model.v1.user.UserContextService.Client userClient = userContextServiceClient.getClient();
80
			in.shop2020.model.v1.user.UserContextService.Client userClient = userContextServiceClient.getClient();
81
			User user = userClient.authenticateUser(email, encryptedPassword);
81
			User user = userClient.authenticateUser(email, encryptedPassword);
82
			userClient.setUserAsLoggedIn(user.getUserId(),(new Date()).getTime());
82
			userClient.setUserAsLoggedIn(user.getUserId(),(new Date()).getTime());
Line 116... Line 116...
116
			userinfo.setNameOfUser(user.getName());
116
			userinfo.setNameOfUser(user.getName());
117
			userinfo.setEmail(email);
117
			userinfo.setEmail(email);
118
			userinfo.setLoggedIn(true);
118
			userinfo.setLoggedIn(true);
119
			userinfo.setPincode(pincode);
119
			userinfo.setPincode(pincode);
120
			userinfo.setCartId(user.getActiveCartId());
120
			userinfo.setCartId(user.getActiveCartId());
121
			int totalItems = userClient.getCart(user.getActiveCartId())
121
			int totalItems = userClient.getCart(user.getActiveCartId()).getLinesSize();
122
					.getLinesSize();
-
 
123
			userinfo.setTotalItems(totalItems);
122
			userinfo.setTotalItems(totalItems);
124
			System.out.println(userinfo);
123
			System.out.println(userinfo);
125
			return true;
124
			return true;
126
		} catch (Exception e) {
125
		} catch (Exception e) {
127
			log.error(UserMessage.USER_AUTHENTICATION_FAILURE);
126
			log.error(UserMessage.USER_AUTHENTICATION_FAILURE);