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

Commit

Permalink
Fix OAuth2 credentials for installed app flow
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-lazar committed Feb 20, 2023
1 parent e438f2a commit aa22a71
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion rtv/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,15 @@ def __init__(self, reddit, term, config):
# unless we know that the server needs to be used.
self.server = None

# Reddit changed their behavior at some point, and the "Installed App"
# flow now expects an empty client secret instead of a dummy string.
client_secret = self.config['oauth_client_secret']
if client_secret == "praw_gapfill":
client_secret = ""

self.reddit.set_oauth_app_info(
self.config['oauth_client_id'],
self.config['oauth_client_secret'],
client_secret,
self.config['oauth_redirect_uri'])

# Reddit's mobile website works better on terminal browsers
Expand Down
2 changes: 1 addition & 1 deletion rtv/templates/rtv.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ force_new_browser_window = False
; These settings are defined at https://www.reddit.com/prefs/apps and should
; not be altered unless you are defining your own developer application.
oauth_client_id = E2oEtRQfdfAfNQ
oauth_client_secret = praw_gapfill
oauth_client_secret =
oauth_redirect_uri = http://127.0.0.1:65000/

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

0 comments on commit aa22a71

Please sign in to comment.