kopia lustrzana https://github.com/ihabunek/toot
Fix test snafu
rodzic
727b3cfad2
commit
5adc9eafdb
|
@ -45,6 +45,7 @@ def test_extract_active_user_app(sample_config):
|
|||
assert app.base_url == 'https://bar.social'
|
||||
assert app.client_id == 'ghi'
|
||||
assert app.client_secret == 'jkl'
|
||||
assert app.redirect_uri == 'urn:ietf:wg:oauth:2.0:oob'
|
||||
|
||||
|
||||
def test_extract_active_when_no_active_user(sample_config):
|
||||
|
|
|
@ -69,6 +69,11 @@ def extract_user_app(config, user_id: str):
|
|||
return None, None
|
||||
|
||||
app_data = config['apps'][instance]
|
||||
|
||||
# Handle a missing `redirect_uri`
|
||||
if 'redirect_uri' not in app_data:
|
||||
app_data['redirect_uri'] = 'urn:ietf:wg:oauth:2.0:oob'
|
||||
|
||||
return User(**user_data), App(**app_data)
|
||||
|
||||
|
||||
|
@ -97,6 +102,8 @@ def load_app(instance: str, redirect_uri: str) -> Optional[App]:
|
|||
# have worked with OOB and there's no need for a `redirect_uri` update. Maybe?
|
||||
if a.redirect_uri == "":
|
||||
a.redirect_uri = "urn:ietf:wg:oauth:2.0:oob"
|
||||
if a.redirect_uri != redirect_uri:
|
||||
a.redirect_uri = redirect_uri
|
||||
return a
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue