feat: 대시보드에 유저의 정보를 불러오기
This commit is contained in:
@@ -92,10 +92,6 @@ const SocialLoginButtons = () => {
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* 로그인 화면 UI (View)
|
||||
* GoogleOAuthProvider로 감싸서 내부에서 useGoogleLogin 훅을 사용할 수 있게 합니다.
|
||||
*/
|
||||
export const SocialLoginGroup = () => {
|
||||
return (
|
||||
<GoogleOAuthProvider clientId={GOOGLE_CLIENT_ID}>
|
||||
|
||||
@@ -21,7 +21,7 @@ export const useSocialLogin = () => {
|
||||
setIsLoading(true);
|
||||
setError(null);
|
||||
|
||||
console.log("token:" + socialToken);
|
||||
console.log(`[${provider}] token:`, socialToken);
|
||||
try {
|
||||
// 1. 백엔드로 소셜 토큰 전송 (토큰 교환)
|
||||
const response = await authApi.loginWithSocial({
|
||||
@@ -50,6 +50,7 @@ export const useSocialLogin = () => {
|
||||
*/
|
||||
const loginWithGoogle = useGoogleLogin({
|
||||
onSuccess: (tokenResponse) => {
|
||||
console.log(tokenResponse);
|
||||
handleSocialLogin("google", tokenResponse.access_token);
|
||||
},
|
||||
onError: () => {
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
export interface SocialLoginRequest {
|
||||
provider: "GOOGLE" | "apple" | "FACEBOOK";
|
||||
provider: "google" | "apple" | "facebook";
|
||||
token: string; // 소셜 프로바이더로부터 발급받은 id_token 또는 access_token
|
||||
}
|
||||
|
||||
export interface AuthResponse {
|
||||
accessToken: string; // VibeRoom 전용 JWT (API 요청 시 사용)
|
||||
refreshToken: string; // 토큰 갱신용
|
||||
user?: UserMeResponse; // 선택적으로 유저 정보를 포함할 수 있음
|
||||
}
|
||||
|
||||
export interface UserMeResponse {
|
||||
id: number;
|
||||
name: string;
|
||||
email: string;
|
||||
grade: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user