Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3292,6 +3292,7 @@ def login():
if not user or not pin_ok:
return render_template("login.html", error="Invalid username or PIN.")

session.permanent = True
session["user_id"] = user["id"]
session["username"] = user["username"]

Expand Down Expand Up @@ -3392,6 +3393,7 @@ def google_auth():
return redirect(session.pop('oauth_redirect_to', url_for("settings")))

# Log them in
session.permanent = True
session["user_id"] = user["id"]
session["username"] = user["username"]
if user["status"] == "blocked":
Expand Down Expand Up @@ -3450,6 +3452,7 @@ def google_auth():
conn.commit()
new_user = conn.execute("SELECT id FROM users WHERE username = ?", (username,)).fetchone()

session.permanent = True
session["user_id"] = new_user["id"]
session["username"] = username
log_activity(new_user["id"], "REGISTER", "User registered via Google")
Expand Down
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Config:
SESSION_COOKIE_SECURE = False # Set True in production with HTTPS
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_SAMESITE = 'Lax'
PERMANENT_SESSION_LIFETIME = timedelta(days=7)
PERMANENT_SESSION_LIFETIME = timedelta(days=30)

# CSRF Protection
WTF_CSRF_ENABLED = True
Expand Down
Loading