Skip to content

Feature/handees login security - #4

Open
git2060 wants to merge 4 commits into
developmentfrom
feature/handees_login_security
Open

git2060 wants to merge 4 commits into
developmentfrom
feature/handees_login_security

Conversation

@git2060

@git2060 git2060 commented Aug 10, 2026 •

Copy link
Copy Markdown
Collaborator

Added login security with hash
updated user_models.py
new file created device.py
new file created signin_attempt.py
updated core -> api -> user -> views.py
2 models added in requirements.txt to install
a. user-agents
b. geoip2

@Curiouspaul1 Curiouspaul1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

work on changes

Comment thread devices.py

print(user_id, flush=True)

pattern = f"device_hash:{user_id}:*"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pattern = f"device_hash:{user_id}:{device_hash}"
if not redis_.exists(pattern):
# trigger warning email.
# logout user, and enforce a re-validation protocol

Comment thread devices.py
user_id=new_user.user_id,
created_at=datetime.datetime.utcnow(),
device_mac=device_data["device_uuid"],
device_name=device_data["device_model"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class SignInAttempts:
    # everything in class..
    @classmethod
    def save_device_hash(cls, session):
         # all the things
          new_signin_attempt = cls(...)
          session.add(new_signing_attempt)
          session.flush()

Comment thread devices.py



def send_emails(to_email, subject, body):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to utils

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants