- LoginModal: 서버에서 구글 클라이언트 ID 수신 시에만 버튼 노출 - 웹/PC: Google Identity Services 렌더 버튼 - 앱(안드로이드): @capawesome/capacitor-google-sign-in 네이티브 버튼 - 네이티브/웹 모두 ID 토큰을 /api/auth/google 로 전달(aud=웹 클라이언트 ID) - auth 스토어/authApi 에 googleLogin·googleClientId 추가 - src/native/googleAuth.js 네이티브 래퍼 신규 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+10
-1
@@ -63,6 +63,15 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
return res
|
||||
}
|
||||
|
||||
// 구글 로그인 — GIS ID 토큰으로 세션 발급
|
||||
async function googleLogin(idToken, rememberMe = true) {
|
||||
const res = await authApi.googleLogin({ idToken, rememberMe })
|
||||
token.value = res.token
|
||||
user.value = res.member
|
||||
await persist()
|
||||
return res
|
||||
}
|
||||
|
||||
async function signup(payload) {
|
||||
return authApi.signup(payload)
|
||||
}
|
||||
@@ -96,7 +105,7 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
await persist()
|
||||
}
|
||||
|
||||
return { token, user, ready, isAuthenticated, restore, login, signup, fetchMe, applyUser, logout, clear }
|
||||
return { token, user, ready, isAuthenticated, restore, login, googleLogin, signup, fetchMe, applyUser, logout, clear }
|
||||
})
|
||||
|
||||
function safeParse(value) {
|
||||
|
||||
Reference in New Issue
Block a user