export const ACCESS_TOKEN_COOKIE = "access_token"
export const REFRESH_TOKEN_COOKIE = "refresh_token"

export const ACCESS_TOKEN_REGEXP = new RegExp(
	/(?:(?:^|.*;\s*)access_token\s*=\s*([^;]*).*$)|^.*$/,
)

export const API_URL = process.env.NEXT_PUBLIC_API_URL

// Paths that can be accessed without authentication and without redirecting to login
export const ESSENTIAL_PATHS = [
	".*/login.*",
	".*/register.*",
	".*/reset-password.*",
	".*/recover.*",
]

// Paths that are excluded from authentication checks
export const EXCLUDED_PATHS = [
	"^/public/.*",
	"^/_next.*",
	"^/static.*",
	"^/fonts.*",
	".*/api.*",
	".*/logout.*",
	".*/confirm-email.*",
	".*/recover.*",
	".*/manifest.json.*",
	".*/android.*",
	".*/apple.*",
	".*/favicon.*",
	".*/workbox.*",
	".*/sw.js.*",
]

export const ENTRY_PATHS_REGEXP = new RegExp(ESSENTIAL_PATHS.join("|"))
export const EXCLUDE_PATHS_REGEXP = new RegExp(EXCLUDED_PATHS.join("|"))
