aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/plugins/basic_auth/__init__.py
diff options
context:
space:
mode:
authorRodney Ewing <ewing.rj@gmail.com>2013-05-27 08:54:25 -0700
committerRodney Ewing <ewing.rj@gmail.com>2013-05-27 08:54:25 -0700
commit3b8c733b98533e6dd7612f071b672b19a97ecf1e (patch)
treed7cfc5abff81f1c24800819d57d80785357ec34e /mediagoblin/plugins/basic_auth/__init__.py
parent3bcdc49088a9fe779b1b95fb1dc42d9ef0c4de00 (diff)
downloadmediagoblin-3b8c733b98533e6dd7612f071b672b19a97ecf1e.tar.lz
mediagoblin-3b8c733b98533e6dd7612f071b672b19a97ecf1e.tar.xz
mediagoblin-3b8c733b98533e6dd7612f071b672b19a97ecf1e.zip
no need for check_login with the new check_login_simple function
Diffstat (limited to 'mediagoblin/plugins/basic_auth/__init__.py')
-rw-r--r--mediagoblin/plugins/basic_auth/__init__.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/mediagoblin/plugins/basic_auth/__init__.py b/mediagoblin/plugins/basic_auth/__init__.py
index fe314504..375af335 100644
--- a/mediagoblin/plugins/basic_auth/__init__.py
+++ b/mediagoblin/plugins/basic_auth/__init__.py
@@ -26,14 +26,6 @@ def setup_plugin():
config = pluginapi.get_config('mediagoblin.pluginapi.basic_auth')
-def check_login(user, password):
- if user.pw_hash:
- result = check_password(password, user.pw_hash)
- if result:
- return result
- return None
-
-
def get_user(username):
user = User.query.filter(
or_(
@@ -49,7 +41,7 @@ def create_user(registration_form):
user = User()
user.username = registration_form.username.data
user.email = registration_form.email.data
- user.pw_hash = igen_password_hash(
+ user.pw_hash = gen_password_hash(
registration_form.password.data)
user.verification_key = unicode(uuid.uuid4())
user.save()
@@ -64,11 +56,11 @@ def get_registration_form(request):
return auth_forms.RegistrationForm(request.form)
-def gen_password_hash(raw_pass, extra_salt):
+def gen_password_hash(raw_pass, extra_salt=None):
return auth_tools.bcrypt_gen_password_hash(raw_pass, extra_salt)
-def check_password(raw_pass, stored_hash, extra_salt):
+def check_password(raw_pass, stored_hash, extra_salt=None):
return auth_tools.bcrypt_check_password(raw_pass, stored_hash, extra_salt)
@@ -89,7 +81,6 @@ def add_to_form_context(context):
hooks = {
'setup': setup_plugin,
'authentication': auth,
- 'auth_check_login': check_login,
'auth_get_user': get_user,
'auth_create_user': create_user,
'auth_get_login_form': get_login_form,