Skip to content

Commit

Permalink
Ready for initial release
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebbedi committed Feb 5, 2024
1 parent ee49454 commit 4f9e636
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PasswordReset(Base):
It is also stored here together with the users UUID.
If the reset password endpoint is accessed this table is checked to ensure that the link is valid and to which user it pertains.
"""
__tablename__ = "passwordreset"
__tablename__ = "password_reset"
# Key which is shared in email
hashed_reset_token = Column(String, primary_key=True, index=True)
# The user which this reset record is connected to
Expand Down
4 changes: 2 additions & 2 deletions back/tmeit_backend/worker_tasks/send_password_reset_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ async def send_password_reset_email(ctx: WorkerContext, email: str, reset_token:
f'Hi {full_name},\n\n'
'You are receiving this email since a pasword reset has been requested for your tmeit account.\n\n'
'If you did not make this request, please ignore this message.\n\n'
f'You can reset your password by visiting <a href=\"localhost:8080/reset/{reset_token}\" target="_blank" rel="noreferrer noopener">tmeit.se/reset/{reset_token}</a>\n\n'
f'You can reset your password by visiting <a href=\"tmeit.se/reset/{reset_token}\" target="_blank" rel="noreferrer noopener">tmeit.se/reset/{reset_token}</a>\n\n'
"XOXO,\n"
"A fucking computer\n"
)

send_email(
sending_user="tmeit",
to_display_name=full_name,
to_email='[email protected]',#to_email=email,
to_email=email,
subject=f"Password reset requested - TMEIT - {str(datetime.now(timezone.utc))[0:16]}",
message_text=body,
message_html=(email_header + convert_body_to_html(body) + '</body></html>'),
Expand Down
3 changes: 2 additions & 1 deletion front/src/app/layouts/PasswordReset.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ function PasswordReset({className}) {
xhr.onload = function () {
if(xhr.status === 200){
setErrorMessage(1);
navigate(0);
alert("Password has been reset!");
navigate("/");
}
else{
alert(`error: ${xhr.status}: ${xhr.statusText}`);
Expand Down

0 comments on commit 4f9e636

Please sign in to comment.