File tree Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -33,27 +33,31 @@ func (at *AccessToken) ToHTTPCookies() Cookies {
33
33
refreshTokenMaxAge := at .ExpiresIn + int (OAuthRefreshTokenMaxAge .Seconds ())
34
34
35
35
accessTokenCookie := & http.Cookie {
36
- Name : cookiey .CookieAccessToken ,
37
- Value : at .AccessToken ,
38
- MaxAge : at .ExpiresIn ,
36
+ Name : cookiey .CookieAccessToken ,
37
+ Value : at .AccessToken ,
38
+ MaxAge : at .ExpiresIn ,
39
+ HttpOnly : true ,
39
40
}
40
41
41
42
refreshTokenCookie := & http.Cookie {
42
- Name : cookiey .CookieRefreshToken ,
43
- Value : at .RefreshToken ,
44
- MaxAge : refreshTokenMaxAge ,
43
+ Name : cookiey .CookieRefreshToken ,
44
+ Value : at .RefreshToken ,
45
+ MaxAge : refreshTokenMaxAge ,
46
+ HttpOnly : true ,
45
47
}
46
48
47
49
tokenTypeCookie := & http.Cookie {
48
- Name : cookiey .CookieTokenType ,
49
- Value : at .TokenType ,
50
- MaxAge : at .ExpiresIn ,
50
+ Name : cookiey .CookieTokenType ,
51
+ Value : at .TokenType ,
52
+ MaxAge : at .ExpiresIn ,
53
+ HttpOnly : true ,
51
54
}
52
55
53
56
scopeCookie := & http.Cookie {
54
- Name : cookiey .CookieScope ,
55
- Value : at .Scope ,
56
- MaxAge : at .ExpiresIn ,
57
+ Name : cookiey .CookieScope ,
58
+ Value : at .Scope ,
59
+ MaxAge : at .ExpiresIn ,
60
+ HttpOnly : true ,
57
61
}
58
62
59
63
isLoggedInCookie := & http.Cookie {
Original file line number Diff line number Diff line change @@ -47,7 +47,6 @@ func (d *discordHandler) OauthCallback(c echo.Context) error {
47
47
cookie .Secure = ! isLocalhost
48
48
cookie .Domain = d .cfg .Discord .RedirectDomain
49
49
cookie .Path = "/"
50
- cookie .HttpOnly = true
51
50
cookie .SameSite = http .SameSiteLaxMode
52
51
53
52
c .SetCookie (cookie )
@@ -75,7 +74,6 @@ func (d *discordHandler) RefreshToken(c echo.Context) error {
75
74
cookie .Secure = ! isLocalhost
76
75
cookie .Domain = d .cfg .Discord .RedirectDomain
77
76
cookie .Path = "/"
78
- cookie .HttpOnly = true
79
77
cookie .SameSite = http .SameSiteLaxMode
80
78
81
79
c .SetCookie (cookie )
You can’t perform that action at this time.
0 commit comments