Skip to content

Commit

Permalink
OAuth1 requires a cache instance.
Browse files Browse the repository at this point in the history
ref: #11
  • Loading branch information
lepture committed Oct 10, 2018
1 parent 96d4e91 commit 4b9c103
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion flask_example/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,24 @@

app = Flask(__name__)
app.config.from_pyfile('config.py')
oauth = OAuth(app)


class Cache(object):
def __init__(self):
self._data = {}

def get(self, k):
return self._data.get(k)

def set(self, k, v, timeout=None):
self._data[k] = v

def delete(self, k):
if k in self._data:
del self._data[k]


oauth = OAuth(app, Cache())


@app.route('/')
Expand Down

0 comments on commit 4b9c103

Please sign in to comment.