1"use strict";(self.webpackChunkmayabot_frontend=self.webpackChunkmayabot_frontend||[]).push([[6188],{6188:(e,s,n)=>{n.r(s),n.d(s,{default:()=>r});var o=n(2555),l=(n(9950),n(6142)),t=n(4414);const r=()=>{const{user:e,logout:s}=(0,l.A)();return(0,t.jsx)("div",{className:"min-h-screen bg-gray-900 text-white p-8",children:(0,t.jsxs)("div",{className:"max-w-4xl mx-auto",children:[(0,t.jsx)("h1",{className:"text-3xl font-bold mb-8 font-mono",children:"\ud83d\udd27 Admin Access Test"}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,t.jsxs)("div",{className:"bg-gray-800 p-6 rounded-lg",children:[(0,t.jsx)("h2",{className:"text-xl font-bold mb-4",children:"Current User Info"}),e?(0,t.jsxs)("div",{className:"space-y-2 font-mono",children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"ID:"})," ",e.id]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Name:"})," ",e.name]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Email:"})," ",e.email]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Role:"})," ",(0,t.jsx)("span",{className:"admin"===e.role?"text-red-400":"text-green-400",children:e.role})]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Is Admin:"})," ",(0,t.jsx)("span",{className:e.is_admin?"text-green-400":"text-red-400",children:e.is_admin?"TRUE":"FALSE"})]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Created:"})," ",e.created_at]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Email Verified:"})," ",e.email_verified_at?"YES":"NO"]})]}):(0,t.jsx)("p",{className:"text-red-400",children:"No user logged in"})]}),(0,t.jsxs)("div",{className:"bg-gray-800 p-6 rounded-lg",children:[(0,t.jsx)("h2",{className:"text-xl font-bold mb-4",children:"LocalStorage Debug"}),(0,t.jsxs)("div",{className:"space-y-2 font-mono text-sm",children:[(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"Auth Token:"})," ",localStorage.getItem("auth_token")?"EXISTS":"MISSING"]}),(0,t.jsxs)("p",{children:[(0,t.jsx)("strong",{children:"User Data:"})," ",localStorage.getItem("user")?"EXISTS":"MISSING"]}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)("button",{onClick:()=>{console.log("Auth Token:",localStorage.getItem("auth_token")),console.log("User Data:",localStorage.getItem("user")),alert("Shiko console p\xebr detaje")},className:"bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded font-mono",children:"Log Storage Data"})})]})]}),(0,t.jsxs)("div",{className:"bg-gray-800 p-6 rounded-lg",children:[(0,t.jsx)("h2",{className:"text-xl font-bold mb-4",children:"Quick Fixes"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("button",{onClick:()=>{if(e){const s=(0,o.A)((0,o.A)({},e),{},{role:"admin",is_admin:!0});localStorage.setItem("user",JSON.stringify(s)),alert("User u vendos si Admin! Rifresho faqen."),window.location.reload()}},className:"w-full bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded font-mono",disabled:!e,children:"\ud83d\udc51 Force Admin Access"}),(0,t.jsx)("button",{onClick:()=>{localStorage.clear(),alert("LocalStorage u pastrua! Logohuni p\xebrs\xebri."),window.location.href="/login"},className:"w-full bg-bitox-accent hover:bg-bitox-accent/80 text-white px-4 py-2 rounded font-mono",children:"\ud83e\uddf9 Clear Storage & Relogin"}),(0,t.jsx)("button",{onClick:async()=>{try{console.log("Testing database connection..."),alert("Shiko console p\xebr rezultatet")}catch(e){console.error("Database test failed:",e)}},className:"w-full bg-green-600 hover:bg-green-700 text-white px-4 py-2 rounded font-mono",children:"\ud83d\uddc4\ufe0f Test Database Connection"})]})]}),(0,t.jsxs)("div",{className:"bg-gray-800 p-6 rounded-lg",children:[(0,t.jsx)("h2",{className:"text-xl font-bold mb-4",children:"Direct Admin Access"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("a",{href:"/admin",className:"block w-full bg-purple-600 hover:bg-purple-700 text-white px-4 py-2 rounded font-mono text-center",children:"\ud83d\ude80 Go to Admin Dashboard"}),(0,t.jsx)("a",{href:"/dashboard",className:"block w-full bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded font-mono text-center",children:"\ud83d\udcca Back to Dashboard"}),null!==e&&void 0!==e&&e.is_admin?(0,t.jsx)("p",{className:"text-green-400 text-center font-mono",children:"\u2705 Admin access should work"}):(0,t.jsx)("p",{className:"text-red-400 text-center font-mono",children:"\u274c No admin access"})]})]})]}),(0,t.jsxs)("div",{className:"mt-8 bg-blue-800/30 p-6 rounded-lg",children:[(0,t.jsx)("h2",{className:"text-xl font-bold mb-4",children:"\ud83c\udfaf Instructions"}),(0,t.jsxs)("div",{className:"space-y-2 font-mono text-sm",children:[(0,t.jsx)("p",{children:"1. Kontrolloni \"Current User Info\" - duhet t\xeb thot\xeb role: 'admin' dhe is_admin: TRUE"}),(0,t.jsx)("p",{children:'2. N\xebse jo, klikoni "\ud83d\udc51 Force Admin Access"'}),(0,t.jsx)("p",{children:'3. Pastaj klikoni "\ud83d\ude80 Go to Admin Dashboard"'}),(0,t.jsx)("p",{children:'4. N\xebse ende nuk punon, klikoni "\ud83e\uddf9 Clear Storage & Relogin" dhe logohuni p\xebrs\xebri'})]})]})]})})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.