Skip to content

Commit

Permalink
Update callback url for SSO and favorite API call (fossasia#200)
Browse files Browse the repository at this point in the history
* update base_path using force_script_name

* fix black style, using url template

* correct sso login url

* update sso url using url template

* update callback url base on base path

* update default base_path

* fix UI, remove default base path

* update api url for favorite call
  • Loading branch information
odkhang authored Sep 24, 2024
1 parent e1fa4a7 commit 2704bde
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 47 deletions.
2 changes: 1 addition & 1 deletion src/pretalx/common/templates/common/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{% endif %}
<div class="panel panel-default">
<div class="panel-heading text-center" id="headingOne">
<a class="btn btn-lg btn-primary btn-block mt-3" href="/login">
<a class="btn btn-lg btn-primary btn-block mt-3" href='{% url "eventyay_common:oauth2_provider.login" %}'>
{% translate "Login with SSO" %}
</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/pretalx/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ def merge_csp(*options, config=None):
"CLIENT_SECRET": SSO_CLIENT_SECRET,
"AUTHORIZE_URL": "/".join([EVENTYAY_TICKET_BASE_PATH, "control/oauth2/authorize/"]),
"ACCESS_TOKEN_URL": "/".join([EVENTYAY_TICKET_BASE_PATH, "control/oauth2/token/"]),
"REDIRECT_URI": "/".join([SITE_URL, "oauth2/callback/"]),
"REDIRECT_URI": "/".join([SITE_URL, BASE_PATH[1:], "oauth2/callback/"]),
"SCOPE": ["profile"],
}
# Set default Application model if using default
Expand All @@ -734,6 +734,6 @@ def merge_csp(*options, config=None):
OAUTHLIB_INSECURE_TRANSPORT = True

LOGOUT_REDIRECT_URL = "/"
LOGIN_URL = "/login/"
LOGIN_URL = BASE_PATH + "/login/"

CORS_ORIGIN_WHITELIST = [EVENTYAY_TICKET_BASE_PATH]
Loading

0 comments on commit 2704bde

Please sign in to comment.