Back

Apple Sign In: No name returned and hide my email doesnt work

  • 1
  • Web
  • Auth
  • Apple
quinvanvegchel
27 Sep, 2024, 12:27

Hi there,

I am currently exploring apple sign in using Appwrite. Google works great, but when I log in using my apple ID there is no name returned. Both the first time, and times after that.

And apple has the function the hide the user's email. Apple provides an private for them. But when I select this function, my actual email is returned instead of the one generated by apple.

How can I solve these two problems?

Would love to hear your thoughts. Code pasted below.

// Functie om in te loggen async function handleGoogleLogin() { account.createOAuth2Session( 'google', 'https://just-roomies.com/test-login2.html', 'https://just-roomies.com/test-login2-fail.html' ) };

TypeScript
    async function handleAppleLogin() {
        account.createOAuth2Session(
            'apple',
            'https://just-roomies.com/test-login2.html',
            'https://just-roomies.com/test-login2-fail.html'
        )
    };

    async function getUser() {
        try{
            const user = await account.get()
            renderProfileScreen(user)
        }catch(error) {
            renderLoginScreen()
        }
    }
    
    function renderLoginScreen() {
        loginScreen.classList.remove('hidden');
    }
    
    function renderProfileScreen(user) {
        userName.textContent = user.name;
        console.log(user)
        profileScreen.classList.remove("hidden");
    }
    
    function handleLogout() {
        account.deleteSession('current')
        profileScreen.classList.add("hidden");
        renderLoginScreen()
    }
    
    getUser()
TL;DR
Developers are experiencing issues with Apple Sign In on Appwrite: - Name is not returned when logging in with Apple ID. - 'Hide my email' function is not working; user's actual email is being returned instead of the Apple-generated one. Solution: - To solve these problems, developers might need to adjust the code handling Apple Sign In to ensure the name is returned and the email privacy feature works correctly.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more