fix(useapplelogin): auth response

This commit is contained in:
Timothy Z. 2025-04-10 20:40:05 +03:00
parent 200d3a76d8
commit a1acb7423a
2 changed files with 8 additions and 6 deletions

View file

@ -9,11 +9,11 @@ type AppleLoginResponse = {
type AppleSignInResponse = {
authorization: {
code: string;
id_token: string;
state: string;
};
user: string;
authorizedData: {
userId: string;
};
email?: string;
fullName?: {
firstName?: string;
@ -52,8 +52,9 @@ const useAppleLogin = (): [() => Promise<AppleLoginResponse>, () => void] => {
.signIn()
.then((response: AppleSignInResponse) => {
if (response.authorization) {
console.log('Apple Sign-In response:', response); // eslint-disable-line no-console
const email = response.email || '';
const sub = response.user;
const sub = response.authorizedData.userId;
let name = '';
if (response.fullName) {

View file

@ -38,9 +38,10 @@ declare global {
}) => void;
signIn: () => Promise<{
authorization: {
code: string;
id_token: string;
state: string;
};
authorizedData: {
userId: string;
};
user: string;
email?: string;