Пример #1
0
    def attempt_login(cls, email: str, password: str) -> bool:
        user = cls.find_by_email(email)

        if not Utils.check_hashed_password(password, user.password):
            raise CustomErrors.IncorrectPasswordError('The username or password you have entered is incorrect.')

        return True
Пример #2
0
    def is_login_valid(cls, email, password):

        user = cls.find_by_email(email)

        if not Utils.check_hashed_password(password, user.password):
            raise error.IncorrectPasswordError(
                'Incorrect password or email try forgot password.')

        return True