Files
auth-remote-react/src/features/auth/api/config/authApi/authApi.ts

20 lines
426 B
TypeScript
Raw Normal View History

import { api as baseApi } from "shared/config";
// Extend base API with authentication hooks
export const api = baseApi.extend({
hooks: {
beforeRequest: [
(request) => {
// Add authentication token to request headers
return request;
},
],
afterResponse: [
async (request, options, response) => {
// Refresh token logic
return response;
},
],
},
});