feat: 토스판 토스 로그인(mTLS 토큰 교환·연결 끊기 콜백)과 좋아요·댓글 다시 열기

This commit is contained in:
minaChoi committed 2026-10-14 15:36:36 +09:00
1 parent e180d9651c
commit ea5376820c
23 files changed
+530 -56

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@ type Events = {
view_gak: { index_id: number; gak_name: string; score: number; rank: number }
select_content: { content_type: 'article'; item_id: number; category: string }
share: { content_type: 'image'; item_id: string; method: 'share_sheet' | 'download'; ratio: string }
login: { method: 'id' }
login: { method: 'id' | 'toss' }
sign_up: { method: 'id' }
region_change: { region_name: string; method: 'list' | 'location' }
}
+6 -3
View File
@@ -1,9 +1,6 @@
/** 웹/앱인토스 차이를 모으는 곳. 토스 SDK 는 토스 빌드(`vite build --mode toss`)에서만 불러온다 */
export const IS_TOSS = import.meta.env.MODE === 'toss'
/** 로그인·좋아요·댓글. 토스판 1차는 보기 전용이라 끈다 */
export const SOCIAL = !IS_TOSS
const TOSS_APP = 'intoss://nalssigak'
// 웹 빌드에서는 이 분기가 지워져 SDK 가 번들에 들어가지 않는다
@@ -31,6 +28,12 @@ export async function tossShare(image: Blob, fileName: string, title: string): P
return saved ? 'saved' : 'link-only'
}
/** 토스: 토스 로그인 창을 띄우고 서버로 보낼 인가 코드를 받는다 */
export async function tossLogin() {
const { TossAuth } = await sdk()
return TossAuth.login()
}
export type TossLocation = { lat: number; lon: number } | 'denied'
/** 토스: 위치를 읽는다. 권한이 없으면 ask 일 때만 권한 창을 띄운다 */