cambio ingreso
This commit is contained in:
parent
3b7faaae03
commit
77058335a3
|
|
@ -100,8 +100,8 @@ const useJwtAuth = <User, SignInPayload, SignUpPayload>(
|
||||||
/**
|
/**
|
||||||
* Handle sign-in success
|
* Handle sign-in success
|
||||||
*/
|
*/
|
||||||
const handleSignInSuccess = useCallback((userData: User) => {
|
const handleSignInSuccess = useCallback((userData: User, accessToken) => {
|
||||||
// setSession(accessToken);
|
setSession(accessToken);
|
||||||
|
|
||||||
setIsAuthenticated(true);
|
setIsAuthenticated(true);
|
||||||
|
|
||||||
|
|
@ -188,7 +188,7 @@ const useJwtAuth = <User, SignInPayload, SignUpPayload>(
|
||||||
|
|
||||||
const userData = response?.data;
|
const userData = response?.data;
|
||||||
|
|
||||||
handleSignInSuccess(userData);
|
handleSignInSuccess(userData, accessToken);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -222,8 +222,8 @@ const useJwtAuth = <User, SignInPayload, SignUpPayload>(
|
||||||
* Sign in
|
* Sign in
|
||||||
*/
|
*/
|
||||||
const signIn = async (credentials: UserLogin) => {
|
const signIn = async (credentials: UserLogin) => {
|
||||||
// const response = axios.post(authConfig.signInUrl, credentials);
|
const response = axios.post(authConfig.signInUrl, credentials);
|
||||||
const {error, bodyOut} = await loginIn(credentials.email, credentials.password);
|
/* const {error, bodyOut} = await loginIn(credentials.email, credentials.password);
|
||||||
|
|
||||||
if(error.codigo === '0'){
|
if(error.codigo === '0'){
|
||||||
const userData = bodyOut.data[0];
|
const userData = bodyOut.data[0];
|
||||||
|
|
@ -232,8 +232,8 @@ const useJwtAuth = <User, SignInPayload, SignUpPayload>(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return bodyOut.data[0];
|
return bodyOut.data[0]; */
|
||||||
/* response.then(
|
response.then(
|
||||||
(res: AxiosResponse<{ user: User; access_token: string }>) => {
|
(res: AxiosResponse<{ user: User; access_token: string }>) => {
|
||||||
const userData = res?.data?.user;
|
const userData = res?.data?.user;
|
||||||
const accessToken = res?.data?.access_token;
|
const accessToken = res?.data?.access_token;
|
||||||
|
|
@ -249,7 +249,7 @@ const useJwtAuth = <User, SignInPayload, SignUpPayload>(
|
||||||
|
|
||||||
return axiosError;
|
return axiosError;
|
||||||
}
|
}
|
||||||
); */
|
);
|
||||||
|
|
||||||
// return response;
|
// return response;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue