PageSourceSearch

https://login.commonsku.com/dist/react/TwoFactorSetupApp.a1d26143.chunk.js

js commonsku.com collected 2026-10-02 03:14:48 UTC 7,005 bytes, 2 lines download raw bytes

1"use strict";(globalThis.__LOADABLE_LOADED_CHUNKS__=globalThis.__LOADABLE_LOADED_CHUNKS__||[]).push([[8078],{7793(s,e,t){t.r(e),t.d(e,{default:()=>y});var i=t(41594),a=t(98483),o=t(69905),n=t(64128),r=t(3602),d=t(34202),c=t(73021),l=t(51904),p=t(28027),h=t(28420),w=t(26926),u=t(22078),g=t(63988);class m extends i.Component{constructor(s){super(s);const{identity:e}=this.props;this.state={twoFactorOn:e.security_2fa,needVerification:!1,pinInvalid:!1,setupSuccessful:!1,pin:"",login_password:"",new_password:"",new_password_confirm:"",password_error:"",password_success:""},this.handleAllowTwoFactor=this.handleAllowTwoFactor.bind(this),this.verifyCode=this.verifyCode.bind(this),this.changePassword=this.changePassword.bind(this)}componentDidMount(){}async handleAllowTwoFactor(s){const e=1==s?1:0;this.setState({needVerification:!0,twoFactorOn:e})}async verifyCode(){let s="";const e=this.state.twoFactorOn;try{s=await(0,u.oD)("GET","login/verify-two-factor",{code:this.state.pin,setup:1})}catch(s){return console.log("Failed to save 2fa setting"),void this.setState({twoFactorOn:1==e?0:1,needVerification:!1,pinInvalid:!0})}if(s.json.data.verified)try{await(0,u.oD)("GET","login/toggle-two-factor",{security_2fa:e}),this.setState({twoFactorOn:1==e?1:0,needVerification:!1,setupSuccessful:!0,pinInvalid:!1})}catch(s){console.log("Failed to save 2fa setting"),this.setState({twoFactorOn:1==e?0:1,needVerification:!1,pinInvalid:!0})}else this.setState({twoFactorOn:1==e?0:1,pin:"",needVerification:!1,pinInvalid:!0})}async changePassword(){if(0===this.state.login_password.length)return this.setState({password_error:"Your current password is required to change your password."}),!1;if(this.state.new_password.length<5)return this.setState({password_error:"Passwords must be at least 5 characters long."}),!1;if(this.state.new_password!==this.state.new_password_confirm)return this.setState({password_error:"Your password confirmation does not match your new password."}),!1;try{return await(0,u.oD)("PUT","password/change",{login_password:this.state.login_password,new_password:this.state.new_password}),this.setState({login_password:"",new_password:"",new_password_confirm:"",password_error:"",password_success:"Your password has been successfully changed."}),!0}catch(s){return this.setState({password_error:"Failed to change password."}),!1}}render(){const{identity:s,security2fa:e}=this.props;return(0,g.jsx)(r.Theme,{"data-test-name":"TwoFactorSetupApp.render",children:(0,g.jsxs)(r.ErrorBoundary,{children:[(0,g.jsx)(c.A,{children:(0,g.jsx)("div",{className:"columns",children:(0,g.jsx)("h4",{style:{display:"inline-block"},children:"Security Setup"})})}),(0,g.jsx)(d.Q,{identity:s,channel:s.user_id,tenantOptions:{chat_welcome_message:"default"},useChatSession:!1,children:(0,g.jsx)(l.A,{children:(0,g.jsx)("div",{className:"main-content shop-config-container",children:(0,g.jsxs)("div",{className:"row section-checkout",style:{padding:"15px",maxWidth:"unset",minHeight:"600px"},children:[(0,g.jsxs)("div",{className:"medium-12 large-6 columns",style:{marginBottom:"15px"},children:[(0,g.jsx)("h3",{children:"Two factor login"}),(0,g.jsxs)("div",{children:[(0,g.jsx)("p",{children:"Your two factor authentication is"}),(0,g.jsx)("div",{children:(0,g.jsxs)(r.Toggle,{children:[(0,g.jsx)(r.ToggleLink,{id:"1",selected:1==this.state.twoFactorOn,onClick:s=>{s.preventDefault(),this.handleAllowTwoFactor(1)},children:"On"}),(0,g.jsx)(r.ToggleLink,{id:"0",selected:0==this.state.twoFactorOn,onClick:s=>{s.preventDefault(),this.handleAllowTwoFactor(0)},children:"Off"})]})})]}),1==this.state.twoFactorOn&&(0,g.jsxs)("div",{style:{marginTop:"3rem"},children:[(0,g.jsx)("div",{children:"Scan the following QR code below to your Authenticator App. Use the 6 digit pin provided from your app to finish your login."}),(0,g.jsx)("div",{children:"More information about 2FA and how it can protect you."}),(0,g.jsx)("div",{style:{marginTop:"1rem"},children:(0,g.jsx)("img",{src:e.qr,alt:"Please reload if the QR code is not shown."})})]}),this.state.needVerification&&(0,g.jsxs)("div",{style:{marginTop:"3rem"},children:[(0,g.jsx)(r.LabeledInput,{style:{width:"15em"},autocomplete:"off",name:"Two Factor Pin Verification",value:this.state.pin,onChange:s=>this.setState({pin:s.target.value}),placeholder:"Enter 6 digit pin to continue"}),(0,g.jsx)(r.Button,{onClick:()=>{this.verifyCode()},children:"Confirm and Change 2FA"})]}),this.state.setupSuccessful&&(0,g.jsx)("p",{style:{color:"green"},children:"You have successfully changed your 2FA setting!"}),this.state.pinInvalid&&(0,g.jsx)("p",{style:{color:"red"},children:"Failed to change set up since the 6 digit pin is invali
1d. Please try again."})]}),(0,g.jsxs)("div",{className:"medium-12 large-6 columns",style:{marginBottom:"15px"},children:[(0,g.jsx)("h3",{children:"Change Password"}),(0,g.jsxs)("div",{children:[(0,g.jsx)(r.LabeledInput,{style:{width:"15em"},type:"password",name:"login_password",value:this.state.login_password,onChange:s=>this.setState({login_password:s.target.value}),placeholder:"Current Password"}),(0,g.jsx)(r.LabeledInput,{style:{width:"15em"},type:"password",name:"new_password",value:this.state.new_password,onChange:s=>this.setState({new_password:s.target.value}),placeholder:"New Password"}),(0,g.jsx)(r.LabeledInput,{style:{width:"15em"},type:"password",name:"new_password_confirm",value:this.state.new_password_confirm,onChange:s=>this.setState({new_password_confirm:s.target.value}),placeholder:"Confirm New Password"}),(0,g.jsx)(r.Button,{onClick:()=>{this.changePassword()},children:"Reset Password"}),(0,g.jsxs)("div",{children:[""!==this.state.password_success&&(0,g.jsx)("p",{style:{color:"green"},children:this.state.password_success}),""!==this.state.password_error&&(0,g.jsx)("p",{style:{color:"red"},children:this.state.password_error})]})]})]})]})})})}),(0,g.jsx)("div",{className:"resku",children:this.props.popups?this.props.popups.map((s,e)=>(0,p.A)(s,e,this.props)):null}),(0,g.jsx)("div",{className:"resku",children:(0,g.jsx)(h.A,{popups:this.props.popups})})]})})}}const y=(0,n.A)((0,a.Ng)((s,e)=>({identity:s.identity,security2fa:s.security2fa,popups:(0,w.ag)(s)}))(m),o.g,!0)},69905(s,e,t){t.d(e,{g:()=>d}),t(48982),t(31128),t(46844);var i=t(46592),a=t(93351),o=t(76603),n=t(97598),r=t(67564);const d={items:function(){let s,e,t,o,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},d=arguments.length>1?arguments[1]:void 0;switch(d.type){case i.gW:return r;case i.MN:return s=d.payload.comment,e=d.payload.comment.presentation_item_id,t=d.payload.comment.presentation_comment_id,o=Object.assign({},r[e],{comments:Object.assign({},r[e].comments,{[t]:s})}),Object.assign({},r,{[e]:o});case a.fc:return n={...r,...d.payload.items},n[d.payload.item_id].options=Object.values(d.payload.items),n[d.payload.item_id].updated=1,n}return r},temp:o.Ay,display:n.A};var c=void 0===c?r.x.initialState:c;c&&(c.display={},c.display.popups=[])}}]);
2//# sourceMappingURL=TwoFactorSetupApp.a1d26143.chunk.js.map

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.