Skip to content

Commit

Permalink
updated route redirections
Browse files Browse the repository at this point in the history
Signed-off-by: James Kunstle <[email protected]>
  • Loading branch information
JamesKunstle committed Sep 22, 2023
1 parent b399810 commit 51dd25c
Show file tree
Hide file tree
Showing 5 changed files with 221 additions and 203 deletions.
10 changes: 5 additions & 5 deletions 8Knot/_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def configure_server_login(server):

# create flask-login object
login = LoginManager(server)
login.login_view = "index"
login.login_view = "/"

class User(UserMixin):
def __init__(self, id):
Expand All @@ -66,7 +66,7 @@ def load_user(id):

@server.route("/logout/")
def logout():
users_cache = StrictRedis(
users_cache = redis.StrictRedis(
host="redis-users",
port=6379,
password=os.getenv("REDIS_PASSWORD", ""),
Expand Down Expand Up @@ -102,7 +102,7 @@ def oauth2_authorize():
provider = os.environ.get("OAUTH_CLIENT_NAME")

if not current_user.is_anonymous:
return redirect(url_for("index"))
return redirect("/")

provider_data = current_app.config["OAUTH2_PROVIDERS"].get(provider)
if provider_data is None:
Expand Down Expand Up @@ -140,7 +140,7 @@ def oauth2_callback():
provider = os.environ.get("OAUTH_CLIENT_NAME")

if not current_user.is_anonymous:
return redirect(url_for("index"))
return redirect("/")

provider_data = current_app.config["OAUTH2_PROVIDERS"].get(provider)
if provider_data is None:
Expand All @@ -151,7 +151,7 @@ def oauth2_callback():
for k, v in request.args.items():
if k.startswith("error"):
flash(f"{k}: {v}")
return redirect(url_for("index"))
return redirect("/")

# make sure that the state parameter matches the one we created in the
# authorization request
Expand Down
4 changes: 2 additions & 2 deletions 8Knot/pages/chaoss/chaoss.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from .visualizations.contrib_activity_cycle import gc_contrib_activity_cycle
from .visualizations.contribs_by_action import gc_contribs_by_action
from .visualizations.project_velocity import gc_project_velocity
from .visualizations.contrib_importance_over_time import gc_contrib_prolificacy_over_time
from .visualizations.contrib_importance_over_time import gc_contrib_prolificacy_over_time
from .visualizations.contrib_importance_pie import gc_contrib_importance_pie

warnings.filterwarnings("ignore")
Expand Down Expand Up @@ -49,7 +49,7 @@
[
dbc.Col(gc_contrib_prolificacy_over_time, width=6),
dbc.Col(gc_contrib_importance_pie, width=6),
],
],
align="center",
style={"marginBottom": ".5%"},
),
Expand Down
Loading

0 comments on commit 51dd25c

Please sign in to comment.