Skip to content
This repository was archived by the owner on Feb 20, 2023. It is now read-only.

Commit aa22a71

Browse files
committed
Fix OAuth2 credentials for installed app flow
1 parent e438f2a commit aa22a71

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

rtv/oauth.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,15 @@ def __init__(self, reddit, term, config):
127127
# unless we know that the server needs to be used.
128128
self.server = None
129129

130+
# Reddit changed their behavior at some point, and the "Installed App"
131+
# flow now expects an empty client secret instead of a dummy string.
132+
client_secret = self.config['oauth_client_secret']
133+
if client_secret == "praw_gapfill":
134+
client_secret = ""
135+
130136
self.reddit.set_oauth_app_info(
131137
self.config['oauth_client_id'],
132-
self.config['oauth_client_secret'],
138+
client_secret,
133139
self.config['oauth_redirect_uri'])
134140

135141
# Reddit's mobile website works better on terminal browsers

rtv/templates/rtv.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ force_new_browser_window = False
7070
; These settings are defined at https://www.reddit.com/prefs/apps and should
7171
; not be altered unless you are defining your own developer application.
7272
oauth_client_id = E2oEtRQfdfAfNQ
73-
oauth_client_secret = praw_gapfill
73+
oauth_client_secret =
7474
oauth_redirect_uri = http://127.0.0.1:65000/
7575

7676
; Port that the rtv webserver will listen on. This should match the redirect

0 commit comments

Comments
 (0)