Skip to content

Commit

Permalink
fix: remove credentials from api calls
Browse files Browse the repository at this point in the history
* fix: credentials removed

* fix: config json data changed

---------

Co-authored-by: codev99 <code.v99@gmail.com>
  • Loading branch information
braghettos and codev99 authored Feb 12, 2024
1 parent a8e8449 commit c3bd216
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
4 changes: 2 additions & 2 deletions public/config/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"api": {
"BFF_API_BASE_URL": "http://20.105.44.127:8080",
"AUTHN_API_BASE_URL": "http://51.138.231.131:8080"
"BFF_API_BASE_URL": "http://localhost:30081",
"AUTHN_API_BASE_URL": "http://localhost:30082"
}
}
4 changes: 0 additions & 4 deletions src/api/apiSlice.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react';
import { RootState } from '../redux/store';

const baseUrl = import.meta.env.VITE_GATEWAY_API_BASE_URL;

export const baseQuery = fetchBaseQuery({
baseUrl: baseUrl,
credentials: 'include',
prepareHeaders: (headers, { getState }) => {
const kubeConfig = (getState() as RootState).auth?.data;
if (kubeConfig) {
Expand Down
3 changes: 0 additions & 3 deletions src/features/auth/authApiSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ export const authApiSlice = apiSlice.injectEndpoints({
getAuthModes: builder.query<AuthModeType[], string>({
query: () => ({
url: `${getBaseUrl()}/strategies`,
credentials: "omit",
headers: {},
}),
}),
authentication: builder.query<AuthResponseType, {body: LoginFormType, url: string}>({
query: (data) => ({
url: `${getBaseUrl()}${data.url}`,
credentials: "omit",
headers: {
Authorization: `Basic ${btoa(`${data.body.username}:${data.body.password}`)}`
},
Expand All @@ -39,7 +37,6 @@ export const authApiSlice = apiSlice.injectEndpoints({
socialAuthentication: builder.query<AuthResponseType, AuthRequestType>({
query: (body) => ({
url: `${getBaseUrl()}${body.url}?name=${body.name}`,
credentials: "omit",
headers: {
'X-Auth-Code': body.code,
}
Expand Down

0 comments on commit c3bd216

Please sign in to comment.