Skip to content

Commit

Permalink
fix: strip redirect URIs for trailing whitespaces (#26006)
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Apr 17, 2024
1 parent e020862 commit cab3b96
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions frappe/oauth.py
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

0 comments on commit cab3b96

Please sign in to comment.