mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +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 = {
|
type AppleSignInResponse = {
|
||||||
authorization: {
|
authorization: {
|
||||||
code: string;
|
|
||||||
id_token: string;
|
id_token: string;
|
||||||
state: string;
|
|
||||||
};
|
};
|
||||||
user: string;
|
authorizedData: {
|
||||||
|
userId: string;
|
||||||
|
};
|
||||||
email?: string;
|
email?: string;
|
||||||
fullName?: {
|
fullName?: {
|
||||||
firstName?: string;
|
firstName?: string;
|
||||||
|
|
@ -52,8 +52,9 @@ const useAppleLogin = (): [() => Promise<AppleLoginResponse>, () => void] => {
|
||||||
.signIn()
|
.signIn()
|
||||||
.then((response: AppleSignInResponse) => {
|
.then((response: AppleSignInResponse) => {
|
||||||
if (response.authorization) {
|
if (response.authorization) {
|
||||||
|
console.log('Apple Sign-In response:', response); // eslint-disable-line no-console
|
||||||
const email = response.email || '';
|
const email = response.email || '';
|
||||||
const sub = response.user;
|
const sub = response.authorizedData.userId;
|
||||||
|
|
||||||
let name = '';
|
let name = '';
|
||||||
if (response.fullName) {
|
if (response.fullName) {
|
||||||
|
|
|
||||||
5
src/types/global.d.ts
vendored
5
src/types/global.d.ts
vendored
|
|
@ -38,9 +38,10 @@ declare global {
|
||||||
}) => void;
|
}) => void;
|
||||||
signIn: () => Promise<{
|
signIn: () => Promise<{
|
||||||
authorization: {
|
authorization: {
|
||||||
code: string;
|
|
||||||
id_token: string;
|
id_token: string;
|
||||||
state: string;
|
};
|
||||||
|
authorizedData: {
|
||||||
|
userId: string;
|
||||||
};
|
};
|
||||||
user: string;
|
user: string;
|
||||||
email?: string;
|
email?: string;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue