Skip to content

Commit 8a23c0c

Browse files
committed
Use the standard debug flag.
1 parent c2d8d45 commit 8a23c0c

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
v1.1, 2017-01-11 -- Use standard debug flag.
12
v1.0, 2016-12-20 -- Initial release.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ only the authentication subsystem is supported.
55

66
The extension works in two modes: development and production.
77
In development, there is no communication with the Firebase
8-
system, accounts sign-in with a simple email form.
8+
system, accounts sign-in with a simple email form. The mode
9+
depends on the `Flask.debug` variable.
910

1011
## Configuration
1112

12-
- `FIREBASE_DEVELOPMENT`: `TRUE` or `FALSE` (default)
1313
- `FIREBASE_API_KEY`: The API key.
1414
- `FIREBASE_PROJECT_ID`: The project identifier, eg. `foobar`.
1515
- `FIREBASE_AUTH_SIGN_IN_OPTIONS`: Comma-separated list of enabled providers.

flask_firebase/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ class FirebaseAuth:
4242
}
4343

4444
def __init__(self, app=None):
45+
self.debug = None
4546
self.api_key = None
4647
self.project_id = None
4748
self.provider_ids = None
4849
self.server_name = None
49-
self.development = None
5050
self.production_load_callback = None
5151
self.development_load_callback = None
5252
self.unload_callback = None
@@ -60,8 +60,8 @@ def __init__(self, app=None):
6060

6161
def init_app(self, app):
6262
app.extensions['firebase_auth'] = self
63-
self.development = app.config.get('FIREBASE_DEVELOPMENT', False)
64-
if self.development:
63+
self.debug = app.debug
64+
if self.debug:
6565
return
6666
self.api_key = app.config['FIREBASE_API_KEY']
6767
self.project_id = app.config['FIREBASE_PROJECT_ID']
@@ -87,7 +87,7 @@ def unloader(self, callback):
8787

8888
def url_for(self, endpoint, **values):
8989
full_endpoint = 'firebase_auth.{}'.format(endpoint)
90-
if self.development:
90+
if self.debug:
9191
return url_for(full_endpoint, **values)
9292
else:
9393
return url_for(
@@ -98,7 +98,7 @@ def url_for(self, endpoint, **values):
9898

9999
def widget(self):
100100
next_ = self.verify_redirection()
101-
if self.development:
101+
if self.debug:
102102
if request.method == 'POST':
103103
self.development_load_callback(request.form['email'])
104104
return redirect(next_)
@@ -110,7 +110,7 @@ def widget(self):
110110
firebase_auth=self)
111111

112112
def sign_in(self):
113-
assert not self.development
113+
assert not self.debug
114114
header = jwt.get_unverified_header(request.data)
115115
with self.lock:
116116
self.refresh_keys()

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='Flask-Firebase',
5-
version='1.0',
5+
version='1.1',
66
description='Google Firebase integration for Flask',
77
packages=['flask_firebase'],
88
include_package_data=True,

0 commit comments

Comments
 (0)