예제 #1
0
def authenticate(username, password):
    print username
    print password
    user = UserModel.find(_username=username)
    print user
    if user is not None:
        if user.verify_password(password):
            return user
예제 #2
0
def authenticate(username, password):
    print username
    print password
    user = UserModel.find(_username=username)
    print user
    if user is not None:
        if user.verify_password(password):
            return user
예제 #3
0
파일: set.py 프로젝트: dan-hill/jabberfire
    def post(self):
        print request.json['token']
        token = PasswordToken.find(_token=request.json['token'])
        if token is not None:
            user = User.find(id=token.user_id)

            user.password = request.json['password']
            return '', 200
        abort(400)
예제 #4
0
파일: set.py 프로젝트: dan-hill/jabberfire
    def post(self):
        print request.json['token']
        token = PasswordToken.find(_token=request.json['token'])
        if token is not None:
            user = User.find(id=token.user_id)

            user.password = request.json['password']
            return '', 200
        abort(400)
예제 #5
0
    def get(self, id):
        user = User.find(id=id)
        user.password = ''.join(random.SystemRandom().choice(string.ascii_uppercase + string.digits) for _ in range(32))
        user.save()

        token = PasswordToken()
        token._token = ''.join(random.SystemRandom().choice(string.ascii_uppercase + string.digits) for _ in range(32))
        token.user_id = user.id
        token.save()

        msg = Message()
        msg.html = render_template('force_email.html', token=token._token)
        msg.recipients = [user.email]
        msg.subject = 'Action Required: CCMA Password Reset'

        mail.send(msg)

        return '', 200
예제 #6
0
    def get(self, id):
        user = User.find(id=id)
        user.password = ''.join(
            random.SystemRandom().choice(string.ascii_uppercase +
                                         string.digits) for _ in range(32))
        user.save()

        token = PasswordToken()
        token._token = ''.join(
            random.SystemRandom().choice(string.ascii_uppercase +
                                         string.digits) for _ in range(32))
        token.user_id = user.id
        token.save()

        msg = Message()
        msg.html = render_template('force_email.html', token=token._token)
        msg.recipients = [user.email]
        msg.subject = 'Action Required: CCMA Password Reset'

        mail.send(msg)

        return '', 200
예제 #7
0
def load_user(payload):
    user = UserModel.find(id=payload['user_id'])
    return user
예제 #8
0
def load_user(payload):
    user = UserModel.find(id=payload['user_id'])
    return user