PageSourceSearch

https://educationamerica.us/assets/ResetPassword-DfA3d4oF.js

js educationamerica.us collected 2026-10-10 00:38:28 UTC 11,885 bytes, 1 lines download raw bytes

1import{_ as T,r as n,y as z,o as U,C as $,i as o,p as P,w as _,T as H,u as S,b as O,d as r,j as f,e as s,t as g,f as G,g as R,m as E,G as V,k,x as Y}from"./index-DQjsBiOF.js";const F={class:"min-h-[80vh] flex items-center justify-center py-8 px-2"},J={key:0,class:"w-full max-w-md bg-white rounded-2xl shadow-xl p-8 border border-gray-100"},K={key:0,class:"text-center"},Q={class:"bg-green-50 border border-green-200 rounded-lg p-4 mb-6"},W={class:"text-green-700 text-sm mb-2"},X={key:1},Z={key:0,class:"text-center py-8"},ee={key:1,class:"text-center"},se={class:"bg-red-50 border border-red-200 rounded-lg p-4 mb-6"},te={class:"text-red-700 text-sm"},oe={class:"relative"},re=["type","disabled"],ae={key:0,class:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ne={key:1,class:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},le={key:0,class:"text-red-600 text-xs mt-1"},ie={class:"relative"},de=["type","disabled"],ue={key:0,class:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ce={key:1,class:"h-5 w-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},pe={key:0,class:"text-red-600 text-xs mt-1"},we={key:0,class:"bg-red-50 border border-red-200 text-red-700 rounded-lg px-4 py-2 text-sm"},me={class:"flex items-start gap-2"},ve=["disabled"],fe={key:0,class:"flex items-center justify-center"},ge={key:1},ye={class:"text-center space-y-2"},xe={class:"text-xs text-gray-500"},be={key:2,class:"mt-8 pt-6 border-t border-gray-200"},ke={class:"text-center text-xs text-gray-500"},he="https://educationamerica.us/api",Pe={__name:"ResetPassword",setup(_e){const C=S(),j=$(),M=n(!1),d=n(!1),u=n(!0),h=n(!1),c=n(!1),p=n(null),w=n(""),L=n(""),y=n(!1),x=n(!1),m=n(""),b=n(""),t=z({password:"",confirmPassword:""}),l=z({});U(async()=>{M.value=!0,await q()});const q=async()=>{try{if(m.value=j.query.token||"",b.value=j.query.employerID||"",!m.value||!b.value){c.value=!0,w.value="Missing required parameters. Please use the complete link from your email.",u.value=!1;return}if(m.value.length!==32||!/^[a-f0-9]+$/i.test(m.value)){c.value=!0,w.value="Invalid token format. Please request a new password reset link.",u.value=!1;return}if(!/^\d+$/.test(b.value)){c.value=!0,w.value="Invalid employer ID. Please request a new password reset link.",u.value=!1;return}u.value=!1}catch(a){console.error("Token validation error:",a),c.value=!0,w.value="Error validating reset link. Please try again.",u.value=!1}},I=()=>{const a={};if(!t.password||!t.password.trim())a.password="Password is required";else{const e=t.password.trim();e.length<6?a.password="Password must be at least 6 characters long":e.length>16&&(a.password="Password must be 16 characters or less")}return!t.confirmPassword||!t.confirmPassword.trim()?a.confirmPassword="Please confirm your password":t.password!==t.confirmPassword&&(a.confirmPassword="Passwords do not match"),{isValid:Object.keys(a).length===0,errors:a}},D=async a=>{try{return(await Y.post(`${he}/empSubmitResetPassword.php`,a,{headers:{"Content-Type":"application/json"},withCredentials:!0})).data}catch(e){throw e.response&&e.response.data?new Error(e.response.data.message||"Password reset failed"):new Error("Network error. Please check your connection and try again.")}},N=async()=>{p.value=null;const a=I();if(Object.keys(l).forEach(e=>delete l[e]),!a.isValid){Object.assign(l,a.errors);return}d.value=!0;try{const e={token:m.value,employerID:b.value,password:t.password.trim(),confirmPassword:t.confirmPassword.trim()},i=await D(e);console.log("Password reset response:",i),i.success?(L.value=i.message,h.value=!0,t.password="",t.confirmPassword=""):p.value=i.message||"Password reset failed"}catch(e){console.error("Password reset error:",e),p.value=e.message||"An error occurred while updating your password. Please try again."}finally{d.value=!1}},B=()=>{C.push("/employer-login")},A=()=>{C.push("/employer/forgot-password")};return(a,e)=>{const i=O("RouterLink");return r(),o("div",F,[P(H,{name:"fade",appear:""},{default:_(()=>[M.value?(r(),o("div",J,[h.value?(r(),o("div",K,[e[5]||(e[5]=s("div",{class:"inline-flex justify-center items-center mb-6 p-4 rounded-full bg-green-100"},[s("svg",{class:"h-8 w-8 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),e[6]||(e[6]=s("h2",{class:"text-2xl font-bold text-gray-900 mb-4"},"Password Updated Successfully!",-1)),s("div",Q,[s("p",W,g(L.value),1),e[4]||(e[4]=s("p",{class:"text-green-600 text-xs"},"You can now access your employer dashboard with your new password.",-1))]),s("div",{class:"space-y-3"},[s("button",{onClick:B,class:"w-full bg-blue-600 hover:bg-blue-700 text-white font-semibold py-3 px-4 roun
1ded-lg transition duration-200"}," Go to Employer Login ")])])):(r(),o("div",X,[e[20]||(e[20]=s("div",{class:"mb-6 text-center"},[s("div",{class:"inline-flex justify-center items-center mb-4 p-2 rounded-full bg-blue-100"},[s("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-8 w-8 text-blue-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})])]),s("h2",{class:"text-2xl font-bold text-gray-900 mb-1"},"Reset Your Password"),s("p",{class:"text-gray-500 text-sm"},"Enter your new password for your employer account")],-1)),u.value?(r(),o("div",Z,e[7]||(e[7]=[s("div",{class:"inline-flex items-center justify-center mb-4"},[s("svg",{class:"animate-spin h-8 w-8 text-blue-600",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[s("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),s("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})])],-1),s("p",{class:"text-gray-600"},"Validating reset token...",-1)]))):c.value?(r(),o("div",ee,[e[8]||(e[8]=s("div",{class:"inline-flex justify-center items-center mb-6 p-4 rounded-full bg-red-100"},[s("svg",{class:"h-8 w-8 text-red-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.732-.833-2.5 0L3.352 16.5c-.77.833.192 2.5 1.732 2.5z"})])],-1)),e[9]||(e[9]=s("h2",{class:"text-2xl font-bold text-gray-900 mb-4"},"Invalid or Expired Link",-1)),s("div",se,[s("p",te,g(w.value),1)]),s("div",{class:"space-y-3"},[s("button",{onClick:A,class:"w-full bg-blue-600 hover:bg-blue-700 text-white font-semibold py-3 px-4 rounded-lg transition duration-200"}," Request New Reset Link "),s("button",{onClick:B,class:"w-full bg-gray-100 hover:bg-gray-200 text-gray-700 font-medium py-2 px-4 rounded-lg transition duration-200"}," Back to Login ")])])):(r(),o("form",{key:2,onSubmit:G(N,["prevent"]),class:"space-y-5"},[s("div",null,[e[12]||(e[12]=s("label",{for:"password",class:"block text-sm font-medium text-gray-700 mb-1"}," New Password * ",-1)),s("div",oe,[R(s("input",{type:y.value?"text":"password",id:"password","onUpdate:modelValue":e[0]||(e[0]=v=>t.password=v),required:"",placeholder:"Enter your new password",class:E(["w-full px-4 py-2 pr-10 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-200 text-gray-900 bg-gray-50",{"border-red-300 bg-red-50":l.password}]),disabled:d.value},null,10,re),[[V,t.password]]),s("button",{type:"button",onClick:e[1]||(e[1]=v=>y.value=!y.value),class:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-gray-600"},[y.value?(r(),o("svg",ae,e[10]||(e[10]=[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.878 9.878L3 3m6.878 6.878L21 21"},null,-1)]))):(r(),o("svg",ne,e[11]||(e[11]=[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},null,-1),s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"},null,-1)])))])]),l.password?(r(),o("p",le,g(l.password),1)):f("",!0),e[13]||(e[13]=s("p",{class:"text-gray-500 text-xs mt-1"},"Password must be 6-16 characters long",-1))]),s("div",null,[e[16]||(e[16]=s("label",{for:"confirmPassword",class:"block text-sm font-medium text-gray-700 mb-1"}," Confirm New Password * ",-1)),s("div",ie,[R(s("input",{type:x.value?"text":"password",id:"confirmPassword","onUpdate:modelValue":e[2]||(e[2]=v=>t.confirmPassword=v),required:"",placeholder:"Confirm your new password",class:E(["w-full px-4 py-2 pr-10 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-200 text-gray-900 bg-gray-50",{"border-red-300 bg-red-50":l.confirmPassword}]),disabled:d.value},null,10,de),[[V,t.confirmPassword]]),s("button",{type:"button",onClick:e[3]||(e[3]=v
1=>x.value=!x.value),class:"absolute inset-y-0 right-0 pr-3 flex items-center text-gray-400 hover:text-gray-600"},[x.value?(r(),o("svg",ue,e[14]||(e[14]=[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.878 9.878L3 3m6.878 6.878L21 21"},null,-1)]))):(r(),o("svg",ce,e[15]||(e[15]=[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"},null,-1),s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"},null,-1)])))])]),l.confirmPassword?(r(),o("p",pe,g(l.confirmPassword),1)):f("",!0)]),p.value?(r(),o("div",we,[s("div",me,[e[17]||(e[17]=s("svg",{class:"w-4 h-4 text-red-600 mt-0.5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[s("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.732-.833-2.5 0L3.352 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),s("div",null,[s("p",null,g(p.value),1)])])])):f("",!0),s("button",{type:"submit",disabled:d.value||!t.password.trim()||!t.confirmPassword.trim(),class:"w-full py-3 px-4 bg-blue-600 hover:bg-blue-700 text-white font-semibold rounded-lg shadow transition disabled:bg-gray-300 disabled:cursor-not-allowed"},[d.value?(r(),o("span",fe,e[18]||(e[18]=[s("svg",{class:"animate-spin -ml-1 mr-3 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[s("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),s("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1),k(" Updating Password... ")]))):(r(),o("span",ge,"Update Password"))],8,ve),s("div",ye,[s("div",xe,[P(i,{to:"/employer-login",class:"text-blue-600 hover:underline"},{default:_(()=>e[19]||(e[19]=[k(" Back to Employer Login ")])),_:1,__:[19]})])])],32))])),h.value?f("",!0):(r(),o("div",be,[s("p",ke,[e[22]||(e[22]=k(" Having trouble? ")),P(i,{to:"/contact",class:"text-blue-600 hover:text-blue-700 hover:underline"},{default:_(()=>e[21]||(e[21]=[k(" Contact our support team ")])),_:1,__:[21]})])]))])):f("",!0)]),_:1})])}}},je=T(Pe,[["__scopeId","data-v-ce1e1b60"]]);export{je as default};

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.