Skip to content

Commit eac18df

Browse files
authored
Merge pull request #54 from DeveloperBlog-Devflow/feature/login-page
feat: 비밀번호 재설정 링크 전송
2 parents 36c39af + 7a94cd8 commit eac18df

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

components/auth/FindPasswordModal.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import { useEffect, useRef, useState } from 'react';
44
import Button from './Button';
55
import FormField from './FormField';
6+
import { auth } from '@/lib/firebase';
7+
import { sendPasswordResetEmail } from 'firebase/auth';
68

79
type FindPasswordModalProps = {
810
onClose: () => void;
@@ -28,6 +30,13 @@ const FindPasswordModal = ({ onClose }: FindPasswordModalProps) => {
2830
}
2931

3032
// 이메일 요청 로직
33+
sendPasswordResetEmail(auth, email)
34+
.then(() => {
35+
alert('이메일이 발송되었습니다.');
36+
})
37+
.catch((error) => {
38+
alert('에러 발생: ' + error.message);
39+
});
3140
};
3241

3342
// esc로 모달을 닫을 수 있는 기능

0 commit comments

Comments
 (0)