Remove Keycloak integration and related authentication logic. Update dashboard to exclude admin page and simplify user management. Introduce new components for chain selection, header, and login form. Refactor main page to handle user authentication and task selection more effectively. Update API routes for challenge-related endpoints.
platform/bro-js/challenge-pl/pipeline/head There was a failure building this commit
platform/bro-js/challenge-pl/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -12,7 +12,6 @@ import type {
|
||||
SystemStats,
|
||||
UserStats,
|
||||
} from '../types'
|
||||
import { keycloak } from '../kc'
|
||||
|
||||
const normalizeBaseUrl = (url: string) => (url.endsWith('/') ? url.slice(0, -1) : url)
|
||||
const backendBaseUrl = normalizeBaseUrl(getConfigValue('challenge.api'))
|
||||
@@ -22,23 +21,8 @@ export const api = createApi({
|
||||
reducerPath: 'challengeApi',
|
||||
baseQuery: fetchBaseQuery({
|
||||
baseUrl: challengeBaseUrl,
|
||||
fetchFn: async (
|
||||
input: RequestInfo | URL,
|
||||
init?: RequestInit,
|
||||
) => {
|
||||
const response = await fetch(input, init)
|
||||
|
||||
if (response.status === 403) keycloak.login()
|
||||
|
||||
return response
|
||||
},
|
||||
prepareHeaders: (headers) => {
|
||||
headers.set('Content-Type', 'application/json;charset=utf-8')
|
||||
|
||||
if (keycloak?.token) {
|
||||
headers.set('Authorization', `Bearer ${keycloak.token}`)
|
||||
}
|
||||
|
||||
return headers
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user