PageSourceSearch

https://graphile-starter.herokuapp.com/_next/static/chunks/pages/settings/security-1dfd3b27ad498706.js

js graphile-starter.herokuapp.com collected 2026-10-03 14:49:16 UTC 3,659 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[934],{40250:function(e,s,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings/security",function(){return r(77126)}])},77126:function(e,s,r){"use strict";r.r(s);var a=r(74512),t=r(99664),n=r(46809),l=r(56719),o=r(65471),i=r(19020),u=r(1961),d=r(67747),c=r(9491),h=r(62450),p=r(89218),w=r.n(p),m=r(32735);let g=()=>{let[e,s]=(0,m.useState)(null),[r,p]=(0,m.useState)(0),[g,y]=(0,m.useState)([]),P=(0,l.useSharedQuery)(),[x]=(0,h.cI)(),[j]=(0,l.useChangePasswordMutation)(),[f,b]=(0,m.useState)(!1),C=(0,m.useCallback)(async e=>{b(!1),s(null);try{await j({variables:{oldPassword:e.oldPassword,newPassword:e.newPassword}}),s(null),b(!0)}catch(r){let e=(0,o.getCodeFromError)(r);"WEAKP"===e?x.setFields([{name:"newPassword",value:x.getFieldValue("newPassword"),errors:["The server believes this passphrase is too weak, please make it stronger"]}]):"CREDS"===e?x.setFields([{name:"oldPassword",value:x.getFieldValue("oldPassword"),errors:["Incorrect old passphrase"]}]):s(r)}},[j,x,s]),{data:S,error:k,loading:E}=(0,l.useSettingsPasswordQuery)(),[Z]=(0,l.useForgotPasswordMutation)(),_=S&&S.currentUser,F=_&&_.userEmails.nodes[0],I=F?F.email:null,[v,N]=(0,m.useState)(!1),[q,T]=(0,m.useState)(null),R=(0,m.useCallback)(()=>{I&&(v||(async()=>{N(!0);try{await Z({variables:{email:I}})}catch(e){T(q)}N(!1)})())},[I,Z,q,v]),[L,O]=(0,m.useState)(!1),U=(0,m.useCallback)(()=>{O(!0)},[O]),V=(0,m.useCallback)(()=>{O(!1)},[O]),[A,D]=(0,m.useState)(!1),M=(0,m.useCallback)(e=>{(0,o.setPasswordInfo)({setPasswordStrength:p,setPasswordSuggestions:y},e,"newPassword"),D(x.isFieldTouched("password"))},[x]);return(0,a.jsx)(n.SettingsLayout,{href:"/settings/security",query:P,children:(()=>{if(E);else if(k)return(0,a.jsx)(n.ErrorAlert,{error:k});else if(S&&S.currentUser&&!S.currentUser.hasPassword)return(0,a.jsxs)("div",{children:[(0,a.jsx)(t.m,{title:"Change passphrase"}),(0,a.jsxs)(n.P,{children:["You registered your account through social login, so you do not currently have a passphrase. If you would like a passphrase, press the button below to request a passphrase reset email to ‘",I,"’ (you can choose a different email by making it primary in ",(0,a.jsx)(w(),{href:"/settings/emails",children:"email settings"}),")."]}),(0,a.jsx)(i.ZP,{onClick:R,disabled:v,children:"Reset passphrase"})]});let s=(0,o.getCodeFromError)(e);return(0,a.jsxs)("div",{children:[(0,a.jsx)(t.m,{title:"Change passphrase"}),(0,a.jsxs)(u.Z,{...o.formItemLayout,form:x,onFinish:C,onValuesChange:M,children:[(0,a.jsx)(u.Z.Item,{label:"Old passphrase",name:"oldPassword",rules:[{required:!0,message:"Please input your passphrase"}],children:(0,a.jsx)(d.Z,{type:"password"})}),(0,a.jsxs)(u.Z.Item,{label:"New passphrase",required:!0,children:[(0,a.jsx)(u.Z.Item,{noStyle:!0,name:"newPassword",rules:[{required:!0,message:"Please confirm your passphrase"}],children:(0,a.jsx)(d.Z,{type:"password",onFocus:U,onBlur:V})}),(0,a.jsx)(n.PasswordStrength,{passwordStrength:r,suggestions:g,isDirty:A,isFocussed:L})]}),e?(0,a.jsx)(u.Z.Item,{children:(0,a.jsx)(c.Z,{type:"error",message:"Changing passphrase failed",description:(0,a.jsxs)("span",{children:[(0,o.extractError)(e).message,s?(0,a.jsxs)("span",{children:[" ","(Error code: ",(0,a.jsxs)("code",{children:["ERR_",s]}),")"]}):null]})})}):f?(0,a.jsx)(u.Z.Item,{children:(0,a.jsx)(c.Z,{type:"success",message:"Password changed!"})}):null,(0,a.jsx)(u.Z.Item,{...o.tailFormItemLayout,children:(0,a.jsx)(i.ZP,{htmlType:"submit",children:"Change Passphrase"})})]})]})})()})};s.default=g}},function(e){e.O(0,[679,664,450,427,774,888,179],function(){return e(e.s=40250)}),_N_E=e.O()}]);

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.