Skip to content

Commit bf9c903

Browse files
committedApr 2, 2024
auth cleanup
1 parent 4397ac1 commit bf9c903

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed
 

‎packages/web-console/src/providers/AuthProvider.tsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,11 @@ const reducer = (s: State, n: Partial<State>) => ({ ...s, ...n })
7373

7474
export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
7575
const settings = useSelector(selectors.console.getSettings)
76-
const [loading, setLoading] = useState(true)
7776
const [sessionData, setSessionData] =
7877
useState<ContextProps["sessionData"]>(undefined)
79-
const [ready, setReady] = useState(false)
8078
const [errorMessage, setErrorMessage] = useState<string | undefined>(
8179
undefined,
8280
)
83-
const [loggedOut, setLoggedOut] = useState(false)
8481
const [state, dispatch] = useReducer(reducer, initialState)
8582

8683
const setAuthToken = (tokenResponse: AuthPayload) => {
@@ -131,7 +128,6 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
131128

132129
const setupOAuth2 = async (settings: ConsoleSettingsShape) => {
133130
if (hasNoAuth(settings)) {
134-
setReady(true)
135131
dispatch({ view: View.ready })
136132
return
137133
}
@@ -336,7 +332,7 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
336332
<Login
337333
onOAuthLogin={switchToOAuth}
338334
onBasicAuthSuccess={() => {
339-
setReady(true)
335+
dispatch({ view: View.ready })
340336
}}
341337
/>
342338
))

0 commit comments

Comments
 (0)
Failed to load comments.