feat(528): 신규 프로젝트 그룹 공통 백엔드 — 종류 칸 · 산림청 판정 · D01 · E01 생성 API · 공유 GET 만 · 가입 go.kr = 산림청
- DB 020(추가만): projects 종류 · 사업연도 끝 · 설계속도 · 원본 칸 · plan_route_years · plan_route_assignees · 회사 「산림청」 행 - is_forest_email · is_forest_service · /api/auth/session 에 is_forest_service - require_project_access 한 곳 — 지정 회사 = GET · HEAD 만 · 그 밖 403 - POST /api/d01/project(산림청만 · PLAN · 설계속도 기본 = resolve_design_speed) · GET /api/dashboard/plan-routes/assigned - GET /api/e01/source-candidates · POST /api/e01/project(B06 완료만 · STABILITY · 원본 칸 · 자료 복사는 528-4) - 종류별 단계 시드(PLAN 3 · STABILITY 4) · storage 허용 D0x · E0x · B01 목록에 project_kind - 가입 인증 — 메일 *.go.kr = 회사 산림청 · ACTIVE · 화면 회사 칸 「산림청」 잠금 표시 - 지킴 시험 test_528_project_groups.py Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ from common_util.common_util_auth import (
|
||||
hash_device_token,
|
||||
hash_password,
|
||||
hash_user_agent,
|
||||
is_forest_email,
|
||||
set_device_token_cookie,
|
||||
verify_password,
|
||||
)
|
||||
@@ -84,17 +85,20 @@ async def verify_registration(payload: RegisterVerifyRequest, request: Request):
|
||||
):
|
||||
raise HTTPException(status_code=400, detail="인증 코드가 유효하지 않습니다.")
|
||||
await consume_otp(otp["id"])
|
||||
await complete_registration(user["id"], bool(user["is_master"]))
|
||||
# 메일 *.go.kr = 회사 「산림청」 고정 — 화면이 보낸 회사 값은 받지 않음(요구 347-8).
|
||||
account_status = await complete_registration(
|
||||
user["id"], bool(user["is_master"]), forest=is_forest_email(user["email"])
|
||||
)
|
||||
# 가입 인증한 브라우저를 신뢰 등록하여 첫 로그인 시 OTP를 생략한다.
|
||||
agent = request.headers.get("user-agent", "unknown")[:1000]
|
||||
device_token = generate_device_token()
|
||||
await trust_device(user["id"], hash_device_token(device_token), hash_user_agent(agent))
|
||||
# 회원가입 시점에는 회사가 없으므로(NO_COMPANY) 마스터 알림은 발송하지 않는다.
|
||||
# 회사 생성/연결은 로그인 후 B01_Dashboard에서 진행한다.
|
||||
# 회사 생성/연결은 로그인 후 B01_Dashboard에서 진행한다(산림청 메일은 위에서 붙음).
|
||||
response = JSONResponse(
|
||||
{
|
||||
"status": "success",
|
||||
"account_status": "NO_COMPANY",
|
||||
"account_status": account_status,
|
||||
}
|
||||
)
|
||||
set_device_token_cookie(response, device_token)
|
||||
|
||||
Reference in New Issue
Block a user