{"id":9,"date":"2025-12-06T18:32:34","date_gmt":"2025-12-06T18:32:34","guid":{"rendered":"https:\/\/ftp-erex.com\/?page_id=9"},"modified":"2025-12-06T18:55:24","modified_gmt":"2025-12-06T18:55:24","slug":"secured-login","status":"publish","type":"page","link":"https:\/\/ftp-erex.com\/","title":{"rendered":"EREX Secured FTP"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"9\" class=\"elementor elementor-9\">\n\t\t\t\t<div class=\"elementor-element elementor-element-6c0f84d e-flex e-con-boxed e-con e-parent\" data-id=\"6c0f84d\" data-element_type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-6a0fd11 elementor-widget elementor-widget-html\" data-id=\"6a0fd11\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n    <title>EREX FTP Login<\/title>\r\n    <link rel=\"stylesheet\" type=\"text\/css\" href=\"style.css\">\r\n    <style>\r\n      <\/style>\r\n<\/head>\r\n<body>\r\n    <div class=\"login-container\">\r\n        <div class=\"logo-container\">\r\n            <img decoding=\"async\" src=\"https:\/\/ftp-erex.com\/wp-content\/uploads\/2025\/12\/company-logo.png\" alt=\"Company Logo\" onerror=\"this.style.display='none'\">\r\n            <h1>EREX Secured FTP <\/h1>\r\n            <p>Please use provided credentials below<\/p>\r\n        <\/div>\r\n        \r\n        <div id=\"errorMessage\" class=\"error-message\"><\/div>\r\n        \r\n        <form id=\"loginForm\">\r\n            <div class=\"form-group\">\r\n                <label for=\"username\">Username<\/label>\r\n                <input type=\"text\" id=\"username\" name=\"username\" required autofocus placeholder=\"Enter your username\">\r\n            <\/div>\r\n            \r\n            <div class=\"form-group\">\r\n                <label for=\"password\">Password<\/label>\r\n                <input type=\"password\" id=\"password\" name=\"password\" required placeholder=\"Enter your password\">\r\n            <\/div>\r\n\r\n            <button type=\"submit\" class=\"login-btn\" id=\"loginBtn\">Sign In<\/button>\r\n            <div class=\"loading\" id=\"loading\">Logging in...<\/div>\r\n        <\/form>\r\n        \r\n        <div class=\"footer-text\">\r\n            &copy; <span id=\"year\"><\/span> EREX. All rights reserved.\r\n        <\/div>\r\n    <\/div>\r\n\r\n    <script>\r\n        document.getElementById('year').textContent = new Date().getFullYear();\r\n        \r\n        \/\/ Check if already logged in\r\n        fetch('\/api\/auth\/check')\r\n            .then(res => res.json())\r\n            .then(data => {\r\n                if (data.authenticated) {\r\n                    window.location.href = '\/dashboard.html';\r\n                }\r\n            })\r\n            .catch(err => console.log('Not logged in'));\r\n        \r\n        document.getElementById('loginForm').addEventListener('submit', async (e) => {\r\n            e.preventDefault();\r\n            \r\n            const username = document.getElementById('username').value;\r\n            const password = document.getElementById('password').value;\r\n            const errorMsg = document.getElementById('errorMessage');\r\n            const loginBtn = document.getElementById('loginBtn');\r\n            const loading = document.getElementById('loading');\r\n            \r\n            \/\/ Clear previous errors\r\n            errorMsg.classList.remove('show');\r\n            loginBtn.disabled = true;\r\n            loading.classList.add('show');\r\n            \r\n            try {\r\n                const response = await fetch('\/api\/login', {\r\n                    method: 'POST',\r\n                    headers: {\r\n                        'Content-Type': 'application\/json'\r\n                    },\r\n                    body: JSON.stringify({ username, password })\r\n                });\r\n                \r\n                const data = await response.json();\r\n                \r\n                if (response.ok) {\r\n                    window.location.href = '\/dashboard.html';\r\n                } else {\r\n                    errorMsg.textContent = data.error || 'Login failed';\r\n                    errorMsg.classList.add('show');\r\n                    loginBtn.disabled = false;\r\n                    loading.classList.remove('show');\r\n                }\r\n            } catch (error) {\r\n                errorMsg.textContent = 'Connection error. Please try again.';\r\n                errorMsg.classList.add('show');\r\n                loginBtn.disabled = false;\r\n                loading.classList.remove('show');\r\n            }\r\n        });\r\n    <\/script>\r\n<\/body>\r\n<\/html>\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>EREX FTP Login EREX Secured FTP Please use provided credentials below Username Password Sign In Logging in&#8230; &copy; EREX. All rights reserved.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"elementor_canvas","meta":{"footnotes":""},"class_list":["post-9","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ftp-erex.com\/index.php\/wp-json\/wp\/v2\/pages\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ftp-erex.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ftp-erex.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ftp-erex.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ftp-erex.com\/index.php\/wp-json\/wp\/v2\/comments?post=9"}],"version-history":[{"count":17,"href":"https:\/\/ftp-erex.com\/index.php\/wp-json\/wp\/v2\/pages\/9\/revisions"}],"predecessor-version":[{"id":33,"href":"https:\/\/ftp-erex.com\/index.php\/wp-json\/wp\/v2\/pages\/9\/revisions\/33"}],"wp:attachment":[{"href":"https:\/\/ftp-erex.com\/index.php\/wp-json\/wp\/v2\/media?parent=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}