Skip to content

Commit e00f0a6

Browse files
committed
Stop tying the admin cookie to the source IP.
This is inconvenient and does not really give additional security.
1 parent 9a0c64c commit e00f0a6

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

cms/server/admin/authentication.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ def set(self, admin_id: int):
9292
9393
"""
9494
self._cookie["id"] = admin_id
95-
self._cookie["ip"] = self._request.remote_addr
9695
self.refresh()
9796

9897
def refresh(self):
@@ -161,21 +160,16 @@ def _verify_cookie(self):
161160
return
162161

163162
admin_id = self._cookie.get("id", None)
164-
remote_addr = self._cookie.get("ip", None)
165163
timestamp = self._cookie.get("timestamp", None)
166164

167-
if admin_id is None or remote_addr is None or timestamp is None:
165+
if admin_id is None or timestamp is None:
168166
self.clear()
169167
return
170168

171169
if not isinstance(admin_id, int) or not isinstance(timestamp, float):
172170
self.clear()
173171
return
174172

175-
if remote_addr != self._request.remote_addr:
176-
self.clear()
177-
return
178-
179173
if make_timestamp() - timestamp > config.admin_cookie_duration:
180174
self.clear()
181175
return

0 commit comments

Comments
 (0)