Kosala Nayanajith Deshapriya commited on
Commit
fcce9fe
·
1 Parent(s): 1b62bbc

Fix Google OAuth iframe 403 block

Browse files
Files changed (2) hide show
  1. dashboard.py +1 -1
  2. youtube_auth.py +3 -0
dashboard.py CHANGED
@@ -674,7 +674,7 @@ if creds is None:
674
  <span class="trust-badge">🛡️ 256-bit Encrypted</span>
675
  <span class="trust-badge">🚫 No Data Stored</span>
676
  </div>
677
- <a href="{auth_url}" target="_self" class="login-btn">
678
  ▶ &nbsp; Sign in with YouTube
679
  </a>
680
  <div class="login-trust-line">
 
674
  <span class="trust-badge">🛡️ 256-bit Encrypted</span>
675
  <span class="trust-badge">🚫 No Data Stored</span>
676
  </div>
677
+ <a href="{auth_url}" target="_blank" class="login-btn">
678
  ▶ &nbsp; Sign in with YouTube
679
  </a>
680
  <div class="login-trust-line">
youtube_auth.py CHANGED
@@ -26,6 +26,9 @@ def get_client_config():
26
  raise FileNotFoundError("No Google credentials found.")
27
 
28
  def get_redirect_uri():
 
 
 
29
  render_url = os.getenv("RENDER_EXTERNAL_URL")
30
  if render_url:
31
  return f"{render_url}/"
 
26
  raise FileNotFoundError("No Google credentials found.")
27
 
28
  def get_redirect_uri():
29
+ space_host = os.getenv("SPACE_HOST")
30
+ if space_host:
31
+ return f"https://{space_host}/"
32
  render_url = os.getenv("RENDER_EXTERNAL_URL")
33
  if render_url:
34
  return f"{render_url}/"