mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 17:15:48 +00:00
fix(useapplelogin): auth response
This commit is contained in:
parent
200d3a76d8
commit
a1acb7423a
2 changed files with 8 additions and 6 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
5
src/types/global.d.ts
vendored
5
src/types/global.d.ts
vendored
|
|
@ -38,9 +38,10 @@ declare global {
|
|||
}) => void;
|
||||
signIn: () => Promise<{
|
||||
authorization: {
|
||||
code: string;
|
||||
id_token: string;
|
||||
state: string;
|
||||
};
|
||||
authorizedData: {
|
||||
userId: string;
|
||||
};
|
||||
user: string;
|
||||
email?: string;
|
||||
|
|
|
|||
Loading…
Reference in a new issue