From 22ba03dea274a9726d15c9c55379869b1cc5feaf Mon Sep 17 00:00:00 2001 From: "Timothy Z." Date: Fri, 25 Apr 2025 14:10:01 +0300 Subject: [PATCH] refactor(useapplelogin): fallback in case no name --- src/routes/Intro/useAppleLogin.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/Intro/useAppleLogin.ts b/src/routes/Intro/useAppleLogin.ts index c5ec99625..6b940e81a 100644 --- a/src/routes/Intro/useAppleLogin.ts +++ b/src/routes/Intro/useAppleLogin.ts @@ -23,7 +23,8 @@ const getCredentials = async (state: string): Promise => { token: user.token, sub: user.sub, email: user.email, - name: user.name + // We might not receive a name from Apple, so we use an empty string as a fallback + name: user.name ?? '', }); } catch (e) { console.error('Failed to get credentials from Apple auth', e);