feat: local 시드에 개발용 세션 토큰 추가
- auth_session 에 'dev-local-token' 시드 (local 프로파일 전용) - 프론트가 실제 소셜 토큰 없이 로그인→/me→로그아웃 플로우를 로컬 검증 가능 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,8 @@ import org.springframework.context.annotation.Profile;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.OffsetDateTime;
|
||||
|
||||
/**
|
||||
* local 프로파일 전용 시드 데이터.
|
||||
* 프론트-백 연동을 곧바로 확인할 수 있도록 유저/강아지/스팟/체크인/한줄평을 채운다.
|
||||
@@ -46,7 +48,15 @@ public class LocalSeedData implements CommandLineRunner {
|
||||
spotService.addReview(hangang, other, "그늘 시원해요", null);
|
||||
spotService.addReview(hangang, me, "물그릇 있음", null);
|
||||
|
||||
System.out.printf("[local seed] me=%d, myDog=%d, spot(한강)=%d 준비 완료%n", me, myDog, hangang);
|
||||
// 개발용 고정 세션 토큰 — 프론트에서 실제 소셜 토큰 없이 로그인 플로우를 검증하기 위함.
|
||||
// (local 프로파일 전용. 프론트 VITE_DEV_LOGIN_TOKEN 과 일치)
|
||||
jdbc.update("""
|
||||
INSERT INTO auth_session(token, user_id, role, remember_me, expires_at, created_at)
|
||||
VALUES ('dev-local-token', ?, 'USER', true, ?, CURRENT_TIMESTAMP)
|
||||
""", me, OffsetDateTime.now().plusDays(365));
|
||||
|
||||
System.out.printf("[local seed] me=%d, myDog=%d, spot(한강)=%d, devToken='dev-local-token' 준비 완료%n",
|
||||
me, myDog, hangang);
|
||||
}
|
||||
|
||||
private long insertUser(String email, String nickname, String tier) {
|
||||
|
||||
Reference in New Issue
Block a user