28 lines
635 B
JavaScript
28 lines
635 B
JavaScript
import { API_BASE_URL, GET, POST } from "../config";
|
|
|
|
// Auth-specific endpoints
|
|
export const AUTH_ENDPOINTS = {
|
|
LOGIN: "/auth/login",
|
|
LOGOUT: "/auth/logout",
|
|
REGISTER: "/auth/register",
|
|
REFRESH: "/auth/refresh",
|
|
ME: "/auth/me",
|
|
REQUEST_PASSWORD_RESET: "/auth/request-password-reset",
|
|
RESET_PASSWORD: "/auth/reset-password",
|
|
CHANGE_PASSWORD: "/auth/change-password",
|
|
};
|
|
|
|
// Auth-specific headers
|
|
export const getAuthHeaders = (token = null) => {
|
|
const headers = {};
|
|
|
|
if (token) {
|
|
headers["Authorization"] = `Bearer ${token}`;
|
|
}
|
|
|
|
return headers;
|
|
};
|
|
|
|
// Export methods with auth context
|
|
export { API_BASE_URL, GET, POST };
|