Skip to content

Commit 14c8eb7

Browse files
committed
fix: account for diff btw local mock and NUSNET
1 parent 3dd92c2 commit 14c8eb7

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,15 +28,20 @@ const LoginVscodeCallback: React.FC = () => {
2828
const location = useLocation();
2929
const { t } = useTranslation('login');
3030
const { isLoggedIn } = useSession();
31-
const { code, ticket, provider: providerId } = parseQuery(location.search);
31+
const {
32+
code,
33+
ticket,
34+
provider: providerId,
35+
'client-request-id': clientRequestId
36+
} = parseQuery(location.search);
3237
const isVscode = useTypedSelector(state => state.vscode.isVscode);
3338
const { access_token: accessToken, refresh_token: refreshToken } = parseQuery(location.search);
3439

3540
// `code` parameter from OAuth2 redirect, `ticket` from CAS redirect (CAS untested for VS Code)
3641
const authCode = code || ticket;
3742

3843
const launchVscode = () => {
39-
window.location.href = `vscode://source-academy.source-academy/sso?code=${authCode}&provider=${providerId}`;
44+
window.location.href = `vscode://source-academy.source-academy/sso?code=${authCode}&client-request-id=${clientRequestId}`;
4045
};
4146

4247
useEffect(() => {

0 commit comments

Comments
 (0)