Subversion Repositories SmartDukaan

Rev

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

Rev 22073 Rev 22075
Line 59... Line 59...
59
	}
59
	}
60
	
60
	
61
	@RequestMapping(value = "/login", method = RequestMethod.POST)
61
	@RequestMapping(value = "/login", method = RequestMethod.POST)
62
	public String login(HttpServletRequest request, HttpServletResponse response, @RequestParam(name = ProfitMandiConstants.TOKEN) String token, Model model) throws Exception{
62
	public String login(HttpServletRequest request, HttpServletResponse response, @RequestParam(name = ProfitMandiConstants.TOKEN) String token, Model model) throws Exception{
63
		try{
63
		try{
-
 
64
			Resource resource = AppConfig.getResource();
-
 
65
			Properties properties = new Properties();
-
 
66
			properties.load(resource.getInputStream());
-
 
67
			
64
			FofoDetails fofoDetails = googleLoginUtil.getFofoDetail(token);
68
			FofoDetails fofoDetails = googleLoginUtil.getFofoDetail(token);
65
			Cookie cookieFofoId = new Cookie(ProfitMandiConstants.FOFO_ID, String.valueOf(fofoDetails.getFofoId()));
69
			Cookie cookieFofoId = new Cookie(ProfitMandiConstants.FOFO_ID, String.valueOf(fofoDetails.getFofoId()));
66
			cookieFofoId.setDomain(request.getServerName());
70
			cookieFofoId.setDomain(request.getServerName());
67
			cookieFofoId.setPath(request.getContextPath());
71
			cookieFofoId.setPath(properties.getProperty("app.context.path"));
68
			Cookie cookieEmailId = new Cookie(ProfitMandiConstants.EMAIL_ID, fofoDetails.getEmailId());
72
			Cookie cookieEmailId = new Cookie(ProfitMandiConstants.EMAIL_ID, fofoDetails.getEmailId());
69
			cookieEmailId.setDomain(request.getServerName());
73
			cookieEmailId.setDomain(request.getServerName());
70
			cookieEmailId.setPath(request.getContextPath());
74
			cookieEmailId.setPath(properties.getProperty("app.context.path"));
71
			response.addCookie(cookieFofoId);
75
			response.addCookie(cookieFofoId);
72
			response.addCookie(cookieEmailId);
76
			response.addCookie(cookieEmailId);
73
			LOGGER.info("Requested token email_id is valid, user login to system, shoud be redirect to /dashboard");
77
			LOGGER.info("Requested token email_id is valid, user login to system, shoud be redirect to /dashboard");
74
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_OK_1002", true, "/profitmandi-fofo/dashboard"));
78
			model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_OK_1002", true, "/profitmandi-fofo/dashboard"));
75
			return "response";
79
			return "response";