Skip to content

Commit

Permalink
frontend: fix getting gssapi url_for
Browse files Browse the repository at this point in the history
  • Loading branch information
nikromen committed Apr 9, 2024
1 parent 7855252 commit db7e16a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions frontend/coprs_frontend/coprs/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from coprs.exceptions import CoprHttpException, AccessRestricted
from coprs.logic.users_logic import UsersLogic
from coprs.oidc import oidc_username_from_userinfo
from coprs.views.apiv3_ns.apiv3_general import GssApiLogin, apiv3_general_ns


class UserAuth:
Expand Down Expand Up @@ -238,8 +239,9 @@ def user_from_username(username, load_metadata=False):
def _krb5_login_redirect(next_url=None):
if app.config['KRB5_LOGIN']:
# Pick the first one for now.
return flask.redirect(flask.url_for("apiv3_ns.gssapi_login",
next=next_url))
return flask.redirect(
apiv3_general_ns.url_for(GssApiLogin, next=next_url)
)
flask.flash("Unable to pick krb5 login page", "error")
return flask.redirect(flask.url_for("coprs_ns.coprs_show"))

Expand Down
3 changes: 2 additions & 1 deletion frontend/coprs_frontend/coprs/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from coprs.constants import BANNER_LOCATION
from coprs.helpers import current_url
from coprs.oidc import oidc_enabled
from coprs.views.apiv3_ns.apiv3_general import GssApiLogin, apiv3_general_ns


@app.context_processor
Expand Down Expand Up @@ -58,7 +59,7 @@ def login_menu():

if config['KRB5_LOGIN']:
menu.append({
'link': flask.url_for("apiv3_ns.gssapi_login"),
'link': apiv3_general_ns.url_for(GssApiLogin),
'desc': config['KRB5_LOGIN']['log_text'],
})

Expand Down

0 comments on commit db7e16a

Please sign in to comment.