File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -160,9 +160,9 @@ pub fn build_refresh_cookie(token: &str) -> String {
160160 token, max_age
161161 )
162162 } else {
163- // 生产环境:设置 Secure 和 SameSite=None(跨域需要)
163+ // 生产环境:设置 Domain 使 Cookie 在主域下共享,避免被浏览器当作第三方 Cookie 拦截
164164 format ! (
165- "refresh_token={}; HttpOnly; Secure; SameSite=None; Path=/api/auth; Max-Age={}" ,
165+ "refresh_token={}; HttpOnly; Secure; SameSite=None; Domain=.exquisitecore.xyz; Path=/api/auth; Max-Age={}" ,
166166 token, max_age
167167 )
168168 }
@@ -176,7 +176,7 @@ pub fn build_clear_refresh_cookie() -> String {
176176 if is_dev {
177177 "refresh_token=; HttpOnly; SameSite=Lax; Path=/api/auth; Max-Age=0" . to_string ( )
178178 } else {
179- "refresh_token=; HttpOnly; Secure; SameSite=None; Path=/api/auth; Max-Age=0" . to_string ( )
179+ "refresh_token=; HttpOnly; Secure; SameSite=None; Domain=.exquisitecore.xyz; Path=/api/auth; Max-Age=0" . to_string ( )
180180 }
181181}
182182
You can’t perform that action at this time.
0 commit comments