Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/pages/login/LoginVscodeCallback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const LoginVscodeCallback: React.FC = () => {
const dispatch = useDispatch();
const location = useLocation();
const { t } = useTranslation('login');
const { isLoggedIn } = useSession();
const { isLoggedIn, courseId } = useSession();
const {
code,
provider: providerId,
Expand All @@ -46,8 +46,13 @@ const LoginVscodeCallback: React.FC = () => {
if (!isVscode) {
launchVscode();
} else {
// If already logged in, navigate to relevant course page
if (isLoggedIn) {
return;
if (courseId !== undefined) {
navigate(`/courses/${courseId}`);
} else {
navigate('/welcome');
}
}
// Fetch JWT tokens and user info from backend when auth provider code is present
dispatch(SessionActions.fetchAuth(code, providerId));
Expand Down
Loading