@@ -3,12 +3,12 @@ import { useState, createContext, useEffect } from 'react';
33import { jwtDecode } from 'jwt-decode' ;
44import { z } from 'zod' ;
55import { useQueryClient } from '@tanstack/react-query' ;
6- import type { SignInSuccessResponse } from '@/modules/worker/services/sign-in/types' ;
76import { browserAuthProvider } from '@/shared/contexts/browser-auth-provider' ;
87import {
98 ModalType ,
109 useModalStore ,
1110} from '@/shared/components/ui/modal/modal.store' ;
11+ import { type AuthTokensSuccessResponse } from '@/shared/schemas' ;
1212
1313const extendableUserDataSchema = z . object ( {
1414 site_key : z . string ( ) . optional ( ) . nullable ( ) ,
@@ -35,15 +35,15 @@ export interface AuthenticatedUserContextType {
3535 user : UserData ;
3636 status : AuthStatus ;
3737 signOut : ( throwExpirationModal ?: boolean ) => void ;
38- signIn : ( singIsSuccess : SignInSuccessResponse ) => void ;
38+ signIn : ( singIsSuccess : AuthTokensSuccessResponse ) => void ;
3939 updateUserData : ( updateUserDataPayload : UpdateUserDataPayload ) => void ;
4040}
4141
4242interface UnauthenticatedUserContextType {
4343 user : null ;
4444 status : AuthStatus ;
4545 signOut : ( throwExpirationModal ?: boolean ) => void ;
46- signIn : ( singIsSuccess : SignInSuccessResponse ) => void ;
46+ signIn : ( singIsSuccess : AuthTokensSuccessResponse ) => void ;
4747}
4848
4949export const AuthContext = createContext <
@@ -112,7 +112,7 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
112112 }
113113 } ;
114114
115- const signIn = ( singIsSuccess : SignInSuccessResponse ) => {
115+ const signIn = ( singIsSuccess : AuthTokensSuccessResponse ) => {
116116 browserAuthProvider . signIn ( singIsSuccess , 'web2' ) ;
117117 handleSignIn ( ) ;
118118 } ;
0 commit comments