Skip to content

Commit 7d7870a

Browse files
authored
fix: UI bug during OAuth login (#3226)
1 parent 72263d5 commit 7d7870a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/pages/login/LoginVscodeCallback.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff 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));

0 commit comments

Comments
 (0)