File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ const LoginVscodeCallback: React.FC = () => {
2828 const dispatch = useDispatch ( ) ;
2929 const location = useLocation ( ) ;
3030 const { t } = useTranslation ( 'login' ) ;
31- const { isLoggedIn } = useSession ( ) ;
31+ const { isLoggedIn, courseId } = useSession ( ) ;
3232 const {
3333 code,
3434 provider : providerId ,
@@ -46,8 +46,13 @@ const LoginVscodeCallback: React.FC = () => {
4646 if ( ! isVscode ) {
4747 launchVscode ( ) ;
4848 } else {
49+ // If already logged in, navigate to relevant course page
4950 if ( isLoggedIn ) {
50- return ;
51+ if ( courseId !== undefined ) {
52+ navigate ( `/courses/${ courseId } ` ) ;
53+ } else {
54+ navigate ( '/welcome' ) ;
55+ }
5156 }
5257 // Fetch JWT tokens and user info from backend when auth provider code is present
5358 dispatch ( SessionActions . fetchAuth ( code , providerId ) ) ;
You can’t perform that action at this time.
0 commit comments