Skip to content

Commit

Permalink
feat/#49/login과 autologin에서 받아오는 userInfo 형식이 다른 것 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmj12 committed Jan 15, 2025
1 parent 7513c77 commit cd0ce6e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
1 change: 0 additions & 1 deletion src/components/LoginModal/LoginModel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ const Modal: React.FC<ModalProps> = ({
if (response.success) {
setLoginState(token, response.data);
}
console.log(response);
} catch {
console.log("error");
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Mypage/MypageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ function MypageMyInfo() {
height={200}
style={{ borderRadius: "50%" }}
/>
<Styles.MypageNickname>{user?.data?.username}</Styles.MypageNickname>
<Styles.MypageEmail>{user?.data?.email}</Styles.MypageEmail>
<Styles.MypageNickname>{user?.username}</Styles.MypageNickname>
<Styles.MypageEmail>{user?.email}</Styles.MypageEmail>
</Styles.MypageMyinfo>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navigation/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Navigation: React.FC = () => {
setAccessToken(newAccessToken);
apiClient.defaults.headers.common.Authorization = `Bearer ${newAccessToken}`;
const userInfo = await getUserInfo();
login(newAccessToken, userInfo);
login(newAccessToken, userInfo.data);
}
} catch (error) {
console.error("자동 로그인 실패:", error);
Expand Down
11 changes: 3 additions & 8 deletions src/lib/interface/iUser.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
export interface IUserData {
export interface IUser {
id: number;
username: string;
email: string;
username: string;
role: string;
// avatarUrl: string | null;
}

export interface IUser {
success: boolean;
data: IUserData | null;
avatarUrl: string | null;
}

0 comments on commit cd0ce6e

Please sign in to comment.