feat: 프론트 인증 연동 (소셜 로그인 + Bearer 세션)
- 로그인 화면: 구글(GIS) 버튼 + 애플 버튼 + 개발용 로그인(local) - 인증 스토어(Pinia): 토큰 복구/로그인/로그아웃, 회원 티어를 광고·매칭 제어에 반영 - HTTP 클라이언트: Authorization Bearer 자동 첨부, 401 시 토큰 폐기 후 로그인 이동 - 라우터 가드: 미로그인 시 보호 경로 → /login (소셜 로그인 전용 앱) - 헤더 회원 메뉴/로그아웃, 체크인 주체를 로그인 회원으로 전환 - 토큰 localStorage 저장(웹/Capacitor 공용) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -75,10 +75,15 @@ import { spotsApi, type Mate, type Review, type Spot } from '@/api/spots'
|
||||
import { matchesApi } from '@/api/matches'
|
||||
import { ApiError } from '@/api/http'
|
||||
import { useSessionStore } from '@/stores/session'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
import NaverMap from '@/components/NaverMap.vue'
|
||||
|
||||
const $q = useQuasar()
|
||||
const session = useSessionStore()
|
||||
const auth = useAuthStore()
|
||||
|
||||
// 체크인/매칭 주체: 로그인한 회원. 강아지 ID 는 아직 견 관리 API 전이라 세션 기본값 사용.
|
||||
const currentUserId = () => auth.member?.id ?? session.userId
|
||||
|
||||
const spots = ref<Spot[]>([])
|
||||
const currentSpot = ref<Spot | null>(null)
|
||||
@@ -123,7 +128,7 @@ async function onCheckIn() {
|
||||
if (!currentSpot.value) return
|
||||
checkingIn.value = true
|
||||
try {
|
||||
await spotsApi.checkIn(currentSpot.value.id, session.userId, session.dogId)
|
||||
await spotsApi.checkIn(currentSpot.value.id, currentUserId(), session.dogId)
|
||||
checkedIn.value = true
|
||||
await refreshSpot(currentSpot.value.id)
|
||||
$q.notify({ color: 'primary', message: '체크인 완료! 스팟 채팅이 열렸어요.', icon: 'place', position: 'top' })
|
||||
|
||||
Reference in New Issue
Block a user