1"use strict";(self.webpackChunkStackby_webapp=self.webpackChunkStackby_webapp||[]).push([[6365],{76365:(e,t,n)=>{n.r(t),n.d(t,{default:()=>N});var o=n(71083),r=n(17041),i=n(49806),a=n(86663),s=n(379),c=n(71468),l=n(62986),u=n(14294),d=n(56429),f=n(9872),p=n(77148),h=n(17851),m=n(56973),y=n(70510);function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function v(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,g(o.key),o)}}function g(e){var t=function(e,t){if("object"!=b(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=b(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==b(t)?t:t+""}function w(e,t,n){return t=j(t),function(e,t){if(t&&("object"==b(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,S()?Reflect.construct(t,n||[],j(e).constructor):t.apply(e,n))}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(S=function(){return!!e})()}
1function j(e){return j=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},j(e)}function k(e,t){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},k(e,t)}var C=function(e){function t(e){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=w(this,t,[e]);var o=a.parse(n.props.location.search).uniqueIdRead,r=void 0===o?null:o;return n.state={tokenCode:"",loading:!1,errorMessage:"",userIdentification:"",userGetLoading:!1,uniqueIdRead:r},n.mfaConfirm=n.mfaConfirm.bind(n),n.getidentity=n.getidentity.bind(n),n.onCancel=n.onCancel.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&k(e,t)}(t,e),n=t,s=[{key:"UNSAFE_componentWillMount",value:function(){var e=a.parse(this.props.location.search).uniqueIdRead,t=void 0===e?null:e,n=this.props.location.state;(null==n?void 0:n.email)||t||this.props.history.push("/login")}},{key:"mfaConfirm",value:function(){var e=this,t=this.state,n=t.tokenCode,r=t.uniqueIdRead;this.setState({loading:!0});var i=this.props.location.state||{},a=i.email,s=i.password,c=i.isStaySignIn;if(r){var l={token:n};r&&(l.uniqueIdRead=r),o.A.post("/api/v1/check2fa",l).then(function(t){e.setState({loading:!1}),0==t.data.data?e.setState({errorMessage:"Invalid code "}):(localStorage.setItem("isMfaSetup",!0),window.location="/dashboard")}).catch(function(t){e.setState({loading:!1})})}else this.props.login({email:a,password:s,isStaySignIn:c,token:n}).then(function(e){e.data,localStorage.setItem("isMfaSetup",!0),window.location="/dashboard"})}},{key:"componentDidMount",value:function(){this.getidentity()}},{key:"getidentity",value:function(){var e=this;o.A.get("/api/v1/getuseridentity").then(function(t){e.setState({userIdentification:JSON.parse((0,f.Y)(t.data.data))})})}},{key:"onCancel",value:function(){var e=this.state.userIdentification;this.setState({userGetLoading:!0});var t={"csrf-token":e};o.A.post("/api/v1/logout",{},{headers:t}).then(function(){(0,r.Md)(),(0,i.d)(),localStorage.removeItem("onBoarded"),localStorage.removeItem("isMfaSetup"),localStorage.removeItem("persist:root"),window.location="/login"})}},{key:"render",value:function(){var e=this,t=this.state,n=t.loading,o=t.tokenCode,r=t.errorMessage,i=t.userGetLoading;return(0,y.jsx)("div",{id:"TwoFactorAuthentication",className:"twofactor-container",children:i?(0,y.jsx)("div",{className:"twofactor-loading",children:(0,y.jsx)("img",{src:"https://stackbybucketprod.s3-ap-southeast-1.amazonaws.com/landingpage/stack_loader.gif",width:"50px"})}):(0,y.jsx)("div",{className:"card-main",children:(0,y.jsxs)(l.A,{className:"twofactor-form",children:[(0,y.jsxs)(u.A,{as:"h2",className:"form-title",children:[(0,y.jsx)("div",{className:"shield-icon-wrapper",children:(0,y.jsx)(m.Eh3,{className:"shield-icon"})}),"Two factor authentication"]}),(0,y.jsx)("p",{className:"form-description",children:"Enter the 6-digit code generated by your authentication app."}),(0,y.jsxs)(l.A.Field,{className:"form-field",children:[(0,y.jsx)("label",{className:"field-label",children:"Authentication code"}),(0,y.jsx)("input",{className:"code-input",value:o,placeholder:"Enter the 6 digit code",onChange:function(t){return e.setState({tokenCode:t.target.value,errorMessage:""})}})]}),r&&(0,y.jsx)(l.A.Field,{className:"error-field",children:(0,y.jsx)("span",{className:"error-message",children:r})}),(0,y.jsxs)("div",{className:"button-group",children:[(0,y.jsx)(d.A,{className:"verify-button",loading:n,type:"submit",positive:!0,onClick:function(){return e.mfaConfirm()},children:"Verify"}),(0,y.jsx)(d.A,{className:"cancel-button",basic:!0,onClick:this.onCancel,children:"Cancel"})]})]})})})}}],s&&v(n.prototype,s),c&&v(n,c),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,s,c}(s.Component);const N=(0,c.Ng)(function(e){return{auth:e.auth}},{login:p.iD})((0,h.A)(C))}}]);
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.