GreedyBear icon indicating copy to clipboard operation
GreedyBear copied to clipboard

Add section where the user can change their password

Open mlodic opened this issue 2 years ago • 2 comments

This can be copy/pasted from IntelOwl

mlodic avatar Jun 01 '24 17:06 mlodic

@mlodic Please assign it to me .

ChaitanyaChute avatar Dec 16 '25 12:12 ChaitanyaChute

Done! :) @ChaitanyaChute , please take a look at the IntelOwl repo and try to adapt the functionality to our project.

regulartim avatar Dec 16 '25 12:12 regulartim

Are you still working on this @ChaitanyaChute ?

regulartim avatar Jan 01 '26 14:01 regulartim

@regulartim I’m currently occupied with exams, so I’m not working on this right now.

ChaitanyaChute avatar Jan 02 '26 08:01 ChaitanyaChute

Ok, give it a try!

regulartim avatar Jan 08 '26 14:01 regulartim

Are you still working on this @ChaitanyaChute ?

regulartim avatar Jan 21 '26 13:01 regulartim

Hi @mlodic I’d like to work on this issue.
This looks simple—I can implement it within a day.

sristyanand00 avatar Jan 25 '26 13:01 sristyanand00

@sristyanand00 you are welcome to the project but please read guidelines before starting contributing. You can be assigned to only one task at a time. Please start with this one

mlodic avatar Jan 25 '26 20:01 mlodic

What's the status here @sristyanand00 ?

regulartim avatar Feb 09 '26 12:02 regulartim

@regulartim Thanks for checking in.
This will be done today. I’ll update the issue once it’s completed.

sristyanand00 avatar Feb 10 '26 05:02 sristyanand00

@sristyanand00 Sorry, but I will unassign you due to inactivity.

regulartim avatar Feb 17 '26 07:02 regulartim

Hi, I've gone through the discussion and the previous PR by @sristyanand00 . Can I get assigned to this?

armoredvortex avatar Feb 19 '26 08:02 armoredvortex

Yes, sure! :)

regulartim avatar Feb 19 '26 09:02 regulartim

I'm not much familiar with django. Any pointers to get started would be appreciated. For the back what i understood so far is I have to create a serializer and a view for ChangePassword and finally add a route. Is that correct?

armoredvortex avatar Feb 19 '26 13:02 armoredvortex

As already mentioned, this can basically be copy/pasted from Intelowl. Maybe take a look how it is solved there. Also take a look at the Django docs. I guess this is a very common functionality, it should be somewhat described there.

regulartim avatar Feb 19 '26 14:02 regulartim

While going through the IntelOwl code i found this

old_password = request.data.get("old_password")
new_password = request.data.get("new_password")

# Check if the old password matches the user's current password
user = request.user
uname = user.username
if not check_password(old_password, user.password):
    ...

# Set the new password for the user
user.set_password(new_password)

new_password is set without any checks (even if its empty string) while a regex REGEX_PASSWORD = r"^(?=.*[a-zA-Z])\S{12,}$" already exists in the codebase to check the validity of a password. It looked like a good addition so I have added the regex match for now. Let me know if this change from the original implementation is okay.

armoredvortex avatar Feb 19 '26 22:02 armoredvortex