This repository has been archived on 2025-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
craft-and-harvest/src/api/auth/config.js

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 };