scragg0x / realms-wiki

Git based wiki inspired by Gollum
http://realms.io
GNU General Public License v2.0
833 stars 91 forks source link

OAuth resp may be set as OAuthException #176

Open nakato opened 7 years ago

nakato commented 7 years ago
Traceback (most recent call last):
  File "./realms/modules/auth/oauth/views.py", line 36, in callback
    profile = User.get_provider_value(provider, 'profile')
AttributeError: 'OAuthException' object has no attribute 'get'

Function authorized_response in flask_oauthlib.client doesn't raise an exception if the exception is OAuthException, it sets data to the exception and then continues. As such the realms oauth view needs to check if resp is an exception, or anything other than what it expects it to be and bail appropriately.