Skip to content

Commit

Permalink
chore: minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Franqsanz committed May 20, 2024
1 parent a897799 commit b82e461
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/pages/profile/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { MySimpleGrid } from '@components/MySimpleGrid';
import { Card } from '@components/cards/Card';
import { Aside } from '@components/Aside';
import { MainHead } from '@components/Head';
import { useProfile } from '@hooks/querys';
import { useProfile } from '@hooks/queries';
import { parseDate } from '@utils/utils';
import { CardType } from '@components/types';
import { ResultLength } from '@components/ResultLength';
Expand Down
2 changes: 1 addition & 1 deletion src/pages/profile/account/MyAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
// import { Card } from '@components/cards/Card';
// import { Aside } from '@components/Aside';
import { MainHead } from '@components/Head';
// import { useProfile } from '@hooks/querys';
// import { useProfile } from '@hooks/queries';
// import { parseDate } from '@utils/utils';
// import { CardType } from '@components/types';
// import ResultLength from '@components/ResultLength';
Expand Down
8 changes: 5 additions & 3 deletions src/services/auth/auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@ import { Button, useColorModeValue } from '@chakra-ui/react';
import { useNavigate } from 'react-router-dom';
import { GrGoogle } from 'react-icons/gr';
import { GoogleAuthProvider, signInWithPopup } from 'firebase/auth';
// import Cookies from 'js-cookie';

import { logIn } from './config';
import { useCheckUser } from '@hooks/querys';
import { useCheckUser } from '@hooks/queries';
import { useAuth } from '@contexts/AuthContext';
import { useAccountActions } from '@hooks/useAccountActions';

export function SignIn() {
const provider = new GoogleAuthProvider();
provider.setCustomParameters({ prompt: 'select_account' });
const navigate = useNavigate();
const { currentUser } = useAuth();
const { logOut } = useAccountActions();
const [userId, setUserId] = useState('');
const { data, isPending, error, refetch } = useCheckUser(userId);
const provider = new GoogleAuthProvider();
provider.setCustomParameters({ prompt: 'select_account' });

async function SignInWithGoogle() {
try {
Expand All @@ -25,6 +26,7 @@ export function SignIn() {
if (result) {
const token = await result.user.getIdToken(true);
await window.localStorage.setItem('app_tk', token);
// Cookies.set('app_tk', token);
// document.cookie = `app_tk=${token}; SameSite=None; path=/;`;
}
} catch (error) {
Expand Down

0 comments on commit b82e461

Please sign in to comment.