[FIX] auth_oauth: hide invalid providers from login screen
authorRichard Mathot <rim@openerp.com>
Wed, 2 Jul 2014 12:07:52 +0000 (14:07 +0200)
committerRichard Mathot <rim@openerp.com>
Wed, 2 Jul 2014 12:07:52 +0000 (14:07 +0200)
addons/auth_oauth/controllers/main.py

index 62eb2e8..8fb7ce9 100644 (file)
@@ -46,7 +46,7 @@ class OAuthController(oeweb.Controller):
             registry = RegistryManager.get(dbname)
             with registry.cursor() as cr:
                 providers = registry.get('auth.oauth.provider')
-                l = providers.read(cr, SUPERUSER_ID, providers.search(cr, SUPERUSER_ID, [('enabled', '=', True)]))
+                l = providers.read(cr, SUPERUSER_ID, providers.search(cr, SUPERUSER_ID, [('enabled', '=', True), ('auth_endpoint', '!=', False), ('validation_endpoint', '!=', False)]))
         except Exception:
             l = []
         return l