사요자 대시보드 추가
This commit is contained in:
@@ -92,7 +92,7 @@ async def verify_session(request: Request) -> dict[str, Any]:
|
||||
expired = now > row[3] or (now - row[4]).total_seconds() > SESSION_IDLE_TIMEOUT_SECONDS
|
||||
# NO_COMPANY(이메일 인증 완료·회사 미연결)도 로그인 유지 대상. 회사 연결 강제는
|
||||
# require_company 의존성에서 별도 처리한다.
|
||||
if expired or row[10] not in ("ACTIVE", "NO_COMPANY"):
|
||||
if expired or row[10] not in ("ACTIVE", "NO_COMPANY", "PENDING"):
|
||||
await cursor.execute("DELETE FROM sessions WHERE id = %s", (session_id,))
|
||||
await connection.commit()
|
||||
raise HTTPException(status_code=401, detail="세션이 만료되었습니다.")
|
||||
|
||||
@@ -35,7 +35,7 @@ async def create_registration(data: dict[str, Any], password_hash: str) -> int:
|
||||
await cursor.execute(
|
||||
"""INSERT INTO users
|
||||
(email, password_hash, name, position, phone, role, is_master, status)
|
||||
VALUES (%s, %s, %s, %s, %s, 'MEMBER', FALSE, 'PENDING_EMAIL')""",
|
||||
VALUES (%s, %s, %s, %s, %s, 'USER', FALSE, 'PENDING_EMAIL')""",
|
||||
(
|
||||
data["email"],
|
||||
password_hash,
|
||||
@@ -152,7 +152,8 @@ async def complete_registration(user_id: int, is_master: bool) -> None:
|
||||
pool = get_db_pool()
|
||||
async with pool.acquire() as connection, connection.cursor() as cursor:
|
||||
await cursor.execute(
|
||||
"""UPDATE users SET status = 'NO_COMPANY', last_email_verified_at = CURRENT_TIMESTAMP
|
||||
"""UPDATE users SET status = 'NO_COMPANY', last_email_verified_at = CURRENT_TIMESTAMP,
|
||||
auth_expires_at = DATE_ADD(CURRENT_TIMESTAMP, INTERVAL 3 MONTH)
|
||||
WHERE id = %s""",
|
||||
(user_id,),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user