Skip to content

Commit

Permalink
v1.3.1
Browse files Browse the repository at this point in the history
Remediate #8 by supplying an anonymous user in cases where a user system is not in use
  • Loading branch information
mwalters committed Mar 27, 2022
1 parent 45907be commit ee51aaf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
16 changes: 7 additions & 9 deletions src/homed.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import urllib.parse
import os, sys, re, yaml, logging, feedparser, requests, datetime, time

version = "1.3.0"
version = "1.3.1"

app = Flask(__name__)
app.logger.setLevel(logging.INFO)
Expand Down Expand Up @@ -235,14 +235,12 @@ def auth_links(sections, headers):


def get_user(headers):
if os.environ["FLASK_ENV"] == "development":
return {
"username": "mwalters",
"name": "Matt",
"email": "test@testing.com",
"groups": ["admins", "users"],
}
user = {}
user = {
"username": "anonymous",
"name": "Anonymous",
"email": "anon@anonymous.com",
"groups": ["admins", "users"],
}
if "Remote-User" in headers:
user["username"] = headers["Remote-User"]
if "Remote-Name" in headers:
Expand Down
2 changes: 1 addition & 1 deletion src/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{% endfor %}

<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">{{ user['name'] }} ({{ user['username'] }}) <i class="icon-user fas fa-user-secret"></i></a>
<a class="nav-link dropdown-toggle" id="navbarDropdown" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">{{ user['username'] }} <i class="icon-user fas fa-user-secret"></i></a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li class="dropdown-item">
<div class="control-darkmode-wrap form-check form-switch">
Expand Down

0 comments on commit ee51aaf

Please sign in to comment.