Files
bssapp/ui/dist/spa/js/238.471bb852.js

1 line
5.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"use strict";(globalThis["webpackChunkbaggisowtfaresystem"]=globalThis["webpackChunkbaggisowtfaresystem"]||[]).push([[238],{2238:(e,a,l)=>{l.r(a),l.d(a,{default:()=>_});var t=l(1347),r=l(7763),o=l(4187),s=l(455),n=l(3022),i=l(2986),u=l(5767);const d={class:"q-mt-xs"},c={__name:"ResetPassword",setup(e){const a=(0,n.A)(),l=(0,s.lq)(),c=(0,s.rd)(),v=(0,u.n)(),g=(0,o.KR)(""),m=(0,o.KR)(""),p=(0,o.KR)(""),b=(0,o.KR)(!1),y=(0,o.KR)(!0),k=(0,o.KR)(!1),f=(0,o.KR)(null),x=(0,o.KR)(!1),h=(0,o.KR)(!1),w=e=>!!e&&e.length>=8||"En az 8 karakter olmalı",A=e=>e===m.value||"Parolalar eşleşmiyor",q=(0,t.EW)(()=>k.value&&m.value.length>=8&&m.value===p.value&&!b.value),C=(0,t.EW)(()=>{const e=m.value||"";let a=0;e.length>=8&&a++,/[A-Z]/.test(e)&&a++,/[0-9]/.test(e)&&a++,/[^A-Za-z0-9]/.test(e)&&a++;const l=[{value:.1,label:"Çok zayıf",color:"red",textColor:"text-red"},{value:.25,label:"Zayıf",color:"orange",textColor:"text-orange"},{value:.5,label:"Orta",color:"amber",textColor:"text-amber"},{value:.75,label:"İyi",color:"blue",textColor:"text-blue"},{value:1,label:"Güçlü",color:"green",textColor:"text-green"}];return l[Math.min(a,l.length-1)]});async function _(){f.value=null,b.value=!0;try{const e=await(0,i.bE)("/password/reset",{token:g.value,password:m.value});if(!e?.success||!e?.token)throw new Error("reset-failed");v.token=e.token,v.user=e.user,v.permissions=Array.isArray(e.permissions)?e.permissions:[],v.role_id=Number(e.user?.role_id||null),v.forcePasswordChange=!1,v.lastLogin=(new Date).toISOString(),localStorage.setItem("token",v.token),localStorage.setItem("user",JSON.stringify(v.user)),localStorage.setItem("permissions",JSON.stringify(v.permissions)),localStorage.setItem("role_id",String(v.role_id)),localStorage.setItem("lastLogin",v.lastLogin),localStorage.setItem("forcePasswordChange","0"),a.notify({type:"positive",message:"Parolanız güncellendi, giriş yapıldı",position:"top-right"}),c.replace("/app")}catch(e){f.value=e?.message||"Parola politikaya uymuyor (büyük/küçük/rakam/özel karakter)",a.notify({type:"negative",message:f.value,position:"top-right"})}finally{b.value=!1}}return(0,t.sV)(async()=>{try{if(g.value=decodeURIComponent(l.params.token||""),!g.value)throw new Error("empty-token");await i.Ay.get(`/password/reset/validate/${g.value}`),k.value=!0}catch{k.value=!1}finally{y.value=!1}}),(e,a)=>{const l=(0,t.g2)("q-inner-loading"),s=(0,t.g2)("q-card-section"),n=(0,t.g2)("q-separator"),i=(0,t.g2)("q-icon"),u=(0,t.g2)("q-input"),v=(0,t.g2)("q-linear-progress"),g=(0,t.g2)("q-banner"),S=(0,t.g2)("q-btn"),L=(0,t.g2)("q-card-actions"),R=(0,t.g2)("q-card"),I=(0,t.g2)("q-page");return(0,t.uX)(),(0,t.Wv)(I,{class:"flex flex-center bg-grey-2"},{default:(0,t.k6)(()=>[y.value?((0,t.uX)(),(0,t.Wv)(l,{key:0,showing:""})):k.value?((0,t.uX)(),(0,t.Wv)(R,{key:1,class:"q-pa-sm",style:{width:"420px","max-width":"90vw"}},{default:(0,t.k6)(()=>[(0,t.bF)(s,null,{default:(0,t.k6)(()=>[...a[5]||(a[5]=[(0,t.Lk)("div",{class:"text-h6 text-weight-bold"}," 🔐 Parola Sıfırlama ",-1),(0,t.Lk)("div",{class:"text-caption text-grey-7 q-mt-xs"}," Yeni parolanızı belirleyin ",-1)])]),_:1}),(0,t.bF)(n),(0,t.bF)(s,null,{default:(0,t.k6)(()=>[(0,t.bF)(u,{modelValue:m.value,"onUpdate:modelValue":a[1]||(a[1]=e=>m.value=e),type:x.value?"text":"password",label:"Yeni Parola",dense:"",filled:"",rules:[w]},{append:(0,t.k6)(()=>[(0,t.bF)(i,{name:x.value?"visibility_off":"visibility",class:"cursor-pointer",onClick:a[0]||(a[0]=e=>x.value=!x.value)},null,8,["name"])]),_:1},8,["modelValue","type","rules"]),(0,t.Lk)("div",d,[(0,t.bF)(v,{value:C.value.value,color:C.value.color,rounded:"",size:"6px"},null,8,["value","color"]),(0,t.Lk)("div",{class:(0,r.C4)(["text-caption q-mt-xs",C.value.textColor])},(0,r.v_)(C.value.label),3)]),(0,t.bF)(u,{modelValue:p.value,"onUpdate:modelValue":a[3]||(a[3]=e=>p.value=e),type:h.value?"text":"password",label:"Parola Tekrar",dense:"",filled:"",class:"q-mt-sm",rules:[A]},{append:(0,t.k6)(()=>[(0,t.bF)(i,{name:h.value?"visibility_off":"visibility",class:"cursor-pointer",onClick:a[2]||(a[2]=e=>h.value=!h.value)},null,8,["name"])]),_:1},8,["modelValue","type","rules"]),f.value?((0,t.uX)(),(0,t.Wv)(g,{key:0,class:"bg-red-1 text-red q-mt-md",rounded:""},{default:(0,t.k6)(()=>[(0,t.eW)((0,r.v_)(f.value),1)]),_:1})):(0,t.Q3)("",!0)]),_:1}),(0,t.bF)(L,{align:"right"},{default:(0,t.k6)(()=>[(0,t.bF)(S,{label:"PAROLAYI GÜNCELLE",color:"primary",loading:b.value,disable:!q.value,onClick:_},null,8,["loading","disable"])]),_:1})]),_:1})):((0,t.uX)(),(0,t.Wv)(R,{key:2,class:"q-pa-md text-center",style:{width:"420px","max-width":"90vw"}},{default:(0,t.k6)(()=>[a[6]||(a[6]=(0,t.Lk)("div",{class:"text-h6 text-red"}," Bağlantı Geçersiz ",-1)),a[7]||(a[7]=(0,t.Lk)("div",{class:"text-caption text-grey-7 q-mt-sm"}," Parola sıfırlama bağlantısı süresi dolmuş veya daha önce kullanılmış olabilir. ",-1)),(0,t.bF)(S,{label:"GİRİŞ SAYFASINA DÖN",color:"primary",class:"q-mt-md",onClick:a[4]||(a[4]=e=>(0,o.R1)(c).push("/"))})]),_:1}))]),_:1})}}};var v=l(5013),g=l(8356),m=l(3341),p=l(222),b=l(6915),y=l(6067),k=l(3933),f=l(3880),x=l(7453),h=l(5034),w=l(2677),A=l(272),q=l.n(A);const C=c,_=C;q()(c,"components",{QPage:v.A,QInnerLoading:g.A,QCard:m.A,QCardSection:p.A,QSeparator:b.A,QInput:y.A,QIcon:k.A,QLinearProgress:f.A,QBanner:x.A,QCardActions:h.A,QBtn:w.A})}}]);