-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- random string 10자리로 조정 - 임시비밀번호 고지 이메일 celery 비동기 처리 - 이메일만 입력하면 비밀번호가 전송되는 점에서 보안관련 이슈 존재
- Loading branch information
Showing
5 changed files
with
69 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
from celery import shared_task | ||
from django.core.mail import EmailMessage | ||
from django.core.mail import EmailMessage, send_mail | ||
from django.template.loader import render_to_string | ||
from django.utils.encoding import force_bytes | ||
from django.utils.http import urlsafe_base64_encode | ||
|
@@ -11,7 +11,7 @@ | |
|
||
|
||
@shared_task | ||
def send_email_verification(user_id: int) -> None: | ||
def send_email_verification(user_id: int): | ||
""" | ||
새로 생성한 유저에게 사용자 인증 이메일을 전송합니다. | ||
""" | ||
|
@@ -27,3 +27,14 @@ def send_email_verification(user_id: int) -> None: | |
) | ||
email_message = EmailMessage(EMAIL_VERIFY_TITLE, message, to=[user.email]) | ||
return email_message.send() | ||
|
||
|
||
@shared_task | ||
def send_temporary_password(email: str, temp_pw: str): | ||
return send_mail( | ||
"[alaltalk] 임시 비밀번호 메일입니다.", | ||
f"회원님의 임시 비밀번호는 {temp_pw} 입니다.\n로그인 후 비밀번호를 꼭 변경해주세요.", | ||
"[email protected]", | ||
[email], | ||
fail_silently=False, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters