ce4ba10f7b
* Added prisma to suggested extension in container * Added comments and authors on drawer with proper resolving * Fix lint * Fix console log * Fixed generated front graphql from rebase * Fixed right drawer width and shared in theme * Added date packages and tooltip * Added date utils and tests * Added comment thread components * Fixed comment chip * wip * wip 2 * - Added string typing for DateTime scalar - Refactored user in a recoil state and workspace using it - Added comment creation * Prepared EditableCell refactor * Fixed line height and tooltip * Fix lint
28 lines
706 B
TypeScript
28 lines
706 B
TypeScript
import { useEffect, useState } from 'react';
|
|
import { useNavigate, useSearchParams } from 'react-router-dom';
|
|
|
|
import { refreshAccessToken } from '@/auth/services/AuthService';
|
|
|
|
export function AuthCallback() {
|
|
const [searchParams] = useSearchParams();
|
|
const [isLoading, setIsLoading] = useState(true);
|
|
|
|
const refreshToken = searchParams.get('refreshToken');
|
|
localStorage.setItem('refreshToken', refreshToken || '');
|
|
const navigate = useNavigate();
|
|
|
|
useEffect(() => {
|
|
async function getAccessToken() {
|
|
await refreshAccessToken();
|
|
setIsLoading(false);
|
|
navigate('/');
|
|
}
|
|
|
|
if (isLoading) {
|
|
getAccessToken();
|
|
}
|
|
}, [isLoading, navigate]);
|
|
|
|
return <></>;
|
|
}
|