def check_auth(token): return con.get(":".join((AUTH_PREFIX, token)))
def get_auth(username, password): """ Tries to get the authentication token.""" authtoken = auth_hash(username, password) if con.get(":".join((AUTH_PREFIX, authtoken))) == username: return authtoken