Subversion Repositories SmartDukaan

Rev

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

Rev 5110 Rev 22627
Line 5... Line 5...
5
 
5
 
6
import in.shop2020.serving.auth.InventoryAuthorizingRealm;
6
import in.shop2020.serving.auth.InventoryAuthorizingRealm;
7
import in.shop2020.thrift.clients.HelperClient;
7
import in.shop2020.thrift.clients.HelperClient;
8
import in.shop2020.utils.HelperService.Client;
8
import in.shop2020.utils.HelperService.Client;
9
 
9
 
-
 
10
import javax.servlet.http.Cookie;
-
 
11
 
10
import org.apache.shiro.SecurityUtils;
12
import org.apache.shiro.SecurityUtils;
11
import org.apache.shiro.crypto.hash.Sha256Hash;
13
import org.apache.shiro.crypto.hash.Sha256Hash;
12
import org.apache.struts2.convention.annotation.Result;
14
import org.apache.struts2.convention.annotation.Result;
13
import org.apache.thrift.TException;
15
import org.apache.thrift.TException;
14
 
16
 
Line 39... Line 41...
39
 
41
 
40
    public String logout()
42
    public String logout()
41
    {
43
    {
42
        log.info("Logging out!");
44
        log.info("Logging out!");
43
        SecurityUtils.getSubject().logout();
45
        SecurityUtils.getSubject().logout();
-
 
46
        Cookie[] cookies = request.getCookies();
-
 
47
        for (Cookie cookie : cookies) {
-
 
48
            cookie.setMaxAge(0);
-
 
49
            cookie.setValue(null);
-
 
50
            cookie.setPath("/inventory");
-
 
51
            response.addCookie(cookie);
-
 
52
        }
-
 
53
 
44
        return "loginPage";
54
        return "loginPage";
45
    }
55
    }
46
 
56
 
47
    public String getPassword() {
57
    public String getPassword() {
48
        return password;
58
        return password;