Skip to content

Commit 246830f

Browse files
committed
fix: remove staled oauth2 login code
1 parent 0f8768c commit 246830f

File tree

2 files changed

+1
-22
lines changed

2 files changed

+1
-22
lines changed

frontend/src/app/pages/LoginPage/LoginForm.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
selectLoginLoading,
2525
selectOauth2Clients,
2626
} from 'app/slice/selectors';
27-
import { getOauth2Clients, tryOauth } from 'app/slice/thunks';
27+
import { getOauth2Clients } from 'app/slice/thunks';
2828
import React, { useCallback, useEffect, useState } from 'react';
2929
import { useDispatch, useSelector } from 'react-redux';
3030
import { Link, useHistory } from 'react-router-dom';
@@ -64,10 +64,6 @@ export function LoginForm({
6464
dispatch(getOauth2Clients());
6565
}, [dispatch]);
6666

67-
useEffect(() => {
68-
dispatch(tryOauth());
69-
}, [dispatch]);
70-
7167
const onSwitch = useCallback(() => {
7268
setSwitchUser(true);
7369
}, []);

frontend/src/app/slice/thunks.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -201,20 +201,3 @@ export const getOauth2Clients = createAsyncThunk<[]>(
201201
}
202202
},
203203
);
204-
205-
export const tryOauth = createAsyncThunk<User>('app/tryOauth', async () => {
206-
try {
207-
const { data } = await request<User>({
208-
url: '/tpa/oauth2login',
209-
method: 'POST',
210-
});
211-
localStorage.setItem(StorageKeys.LoggedInUser, JSON.stringify(data));
212-
setTimeout(() => {
213-
window.location.href = '/';
214-
});
215-
return data;
216-
} catch (error) {
217-
errorHandle(error);
218-
throw error;
219-
}
220-
});

0 commit comments

Comments
 (0)