def sqlalchemy_provider(app): spf = SanicPluginsFramework(app) oauth = spf.register_plugin(oauth2provider) bind_sqlalchemy(oauth, db.session, user=User, token=Token, client=Client, grant=Grant, current_user=current_user) return oauth
def cache_provider(app): spf = SanicPluginsFramework(app) oauth = spf.register_plugin(oauth2provider) bind_sqlalchemy(oauth, db.session, user=User, token=Token, client=Client, current_user=current_user) app.config.update({'OAUTH2_CACHE_TYPE': 'simple'}) bind_cache_grant(app, oauth, current_user) return oauth
def bind_cache_provider(oauth, app): bind_sqlalchemy(oauth, db.session, user=User, token=Token, client=Client, current_user=current_user) app.config.update({'OAUTH2_CACHE_TYPE': 'simple'}) bind_cache_grant(app, oauth, current_user) return oauth