헤더 검색 중앙 정렬·Resend 이메일 OTP·비밀번호 찾기 (v0.0.99)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -60,7 +60,7 @@ export const getUserByEmail = async (email) => {
|
||||
last_seen_at AS "lastSeenAt",
|
||||
last_seen_ip AS "lastSeenIp"
|
||||
FROM users
|
||||
WHERE email = ${email}
|
||||
WHERE lower(email) = lower(${email})
|
||||
LIMIT 1
|
||||
`
|
||||
|
||||
@@ -214,6 +214,25 @@ export const updateMemberProfile = async (input) => {
|
||||
return rows?.[0] || null
|
||||
}
|
||||
|
||||
/**
|
||||
* 이메일(대소문자 무시)로 비밀번호 해시를 갱신한다.
|
||||
* @param {{ email: string, passwordHash: string }} input - 입력
|
||||
* @returns {Promise<boolean>} 갱신된 행이 있으면 true
|
||||
*/
|
||||
export const updateMemberPasswordByEmail = async (input) => {
|
||||
const sql = requireSql()
|
||||
const rows = await sql`
|
||||
UPDATE users
|
||||
SET
|
||||
password_hash = ${input.passwordHash},
|
||||
updated_at = now()
|
||||
WHERE lower(email) = lower(${input.email})
|
||||
RETURNING id
|
||||
`
|
||||
|
||||
return Boolean(rows?.[0])
|
||||
}
|
||||
|
||||
/**
|
||||
* 회원 비밀번호 변경
|
||||
* @param {{ userId: string, passwordHash: string }} input - 수정 값
|
||||
|
||||
Reference in New Issue
Block a user