Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: strip redirect URIs for trailing whitespaces (backport #26006) #26008

Merged
merged 1 commit into from
Apr 17, 2024
Merged
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
8 changes: 5 additions & 3 deletions frappe/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import frappe
from frappe.auth import LoginManager
from frappe.utils.data import get_system_timezone, now_datetime
from frappe.utils.data import cstr, get_system_timezone, now_datetime


class OAuthWebRequestValidator(RequestValidator):
Expand All @@ -29,8 +29,10 @@ def validate_redirect_uri(self, client_id, redirect_uri, request, *args, **kwarg
# Is the client allowed to use the supplied redirect_uri? i.e. has
# the client previously registered this EXACT redirect uri.

redirect_uris = frappe.db.get_value("OAuth Client", client_id, "redirect_uris").split(
get_url_delimiter()
redirect_uris = (
cstr(frappe.db.get_value("OAuth Client", client_id, "redirect_uris"))
.strip()
.split(get_url_delimiter())
)

if redirect_uri in redirect_uris:
Expand Down
Loading