Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: kakao user profile type mismatch for web #45

Open
3 tasks done
daeuk1011 opened this issue Nov 7, 2024 · 0 comments
Open
3 tasks done

[BUG]: kakao user profile type mismatch for web #45

daeuk1011 opened this issue Nov 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@daeuk1011
Copy link

daeuk1011 commented Nov 7, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Name, Version of @react-native-kakao/*

user, v2.2.6

Version of react-native

0.74.5

What os are you seeing the problem on?

Web

What device types are you seeing the problem on?

Physcial Device

What architecture types of react native are you seeing the problem on?

New Architecture(Fabric)

Version of device(android API, iOS OS version, etc...)

No response

Expo App

  • I am using Expo

What happened?

Problem Description

The me() function returns a type that is different from the expected one as defined in the interface. Below is the detailed information:

  1. Returned Type from me() (Web Login):
    The actual data returned by the me() function from the web login is of the following structure:

    // example user interface
    interface WebUserInfo {
      id: number;
      connectedAt: number;
      properties: {
        nickname: string;
        profileImage: string;
        thumbnailImage: string;
      };
      kakaoAccount: {
        profileNicknameNeedsAgreement: boolean;
        profileImageNeedsAgreement: boolean;
        profile: {
          nickname: string;
          thumbnailImageUrl: string;
          profileImageUrl: string;
          isDefaultImage: boolean;
          isDefaultNickname: boolean;
        };
        hasEmail: boolean;
        emailNeedsAgreement: boolean;
        isEmailValid: boolean;
        isEmailVerified: boolean;
        email: string;
      };
    }
  2. Expected Type from me():
    The expected return type for me() is defined in the KakaoUser interface:

    interface KakaoUser {
      id: number;
      email: string;
      name: string;
      nickname: string;
      profileImageUrl: string;
      thumbnailImageUrl: string;
      phoneNumber: string;
      ageRange: string;
      birthday: string;
      birthdayType: string;
      birthyear: string;
      gender: string;
      isEmailValid: boolean;
      isEmailVerified: boolean;
      isKorean: boolean;
      ageRangeNeedsAgreement?: boolean;
      birthdayNeedsAgreement?: boolean;
      birthyearNeedsAgreement?: boolean;
      emailNeedsAgreement?: boolean;
      genderNeedsAgreement?: boolean;
      isKoreanNeedsAgreement?: boolean;
      phoneNumberNeedsAgreement?: boolean;
      profileNeedsAgreement?: boolean;
      ciNeedsAgreement?: boolean;
      nameNeedsAgreement?: boolean;
      profileImageNeedsAgreement?: boolean;
      profileNicknameNeedsAgreement?: boolean;
      legalBirthDateNeedsAgreement?: boolean;
      connectedAt?: number;
      synchedAt?: number;
    }
  3. Problem:

    The data returned by me() does not match the structure of the KakaoUser interface. The fields in the UserInfo type are different, and certain fields are missing or have different names. This inconsistency is causing issues with type safety and leads to confusion when handling the user data.

Request:

Please either:

  1. Adjust the return type of the me() function to match the KakaoUser interface for both web and app logins.
  2. Or, modify the type definitions to support both structures (WebUserInfo and KakaoUser) consistently.

This discrepancy is causing issues with type safety and leads to confusion when handling the user data, especially when dealing with both web and app login flows.

Relevant a package.json.

No response

Relevant log output

No response

Reproducible Sample Repository

Code of Conduct

  • I agree to follow this project's Code of Conduct
@daeuk1011 daeuk1011 added the bug Something isn't working label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant