20 lines
426 B
TypeScript
20 lines
426 B
TypeScript
|
|
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;
|
||
|
|
},
|
||
|
|
],
|
||
|
|
},
|
||
|
|
});
|