Save password as md5

This commit is contained in:
Ruud
2011-12-18 12:09:13 +01:00
parent 62f3121b46
commit e891287d3e
4 changed files with 19 additions and 5 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
from couchpotato.core.helpers.variable import md5
from couchpotato.environment import Env
from flask import request, Response
from functools import wraps
@@ -16,7 +17,7 @@ def requires_auth(f):
@wraps(f)
def decorated(*args, **kwargs):
auth = getattr(request, 'authorization')
if Env.setting('username') and (not auth or not check_auth(auth.username, auth.password)):
if Env.setting('username') and (not auth or not check_auth(auth.username, md5(auth.password))):
return authenticate()
return f(*args, **kwargs)