PageSourceSearch

https://secure.countingup.com/static/js/web_login.7c8fe2f5.chunk.js

js countingup.com collected 2026-10-02 02:46:29 UTC 10,789 bytes, 2 lines download raw bytes

1(this["webpackJsonpweb-app"]=this["webpackJsonpweb-app"]||[]).push([[28],{1898:function(e,t,n){"use strict";n.r(t);var c=n(0),a=n(55),r=n(1174),i=n(38),o=n.n(i),s=n(75),l=n(7),j=n(78),u=n(127),b=n(1178),d=n(1206),p=n(1161),O=n(43),h=n(26),g=n(1216),x=n(1103),f=n.p+"static/media/LoginIllustration.c207d459.svg",m=n(323),y=n(1),k=function(e){var t=e.children;return Object(y.jsxs)(j.Stack,{height:"100%",children:[Object(y.jsx)(g.c,{}),Object(y.jsx)(j.Container,{sx:{py:2},children:Object(y.jsxs)(j.Grid,{container:!0,children:[Object(y.jsx)(j.Grid,{item:!0,lg:6,display:{xs:"none",lg:"block"},children:Object(y.jsx)(m.a,{padding:6,children:Object(y.jsx)("img",{src:f,alt:"Man with laptop"})})}),Object(y.jsx)(j.Grid,{item:!0,xs:!0,lg:6,children:Object(y.jsx)(m.a,{paddingTop:{xs:2,lg:6},children:t})})]})}),Object(y.jsx)(g.b,{})]})},v=function(){var e=Object(O.a)(),t=function(e){var t=e.body;return Object(y.jsxs)(j.Stack,{direction:"row",alignItems:"center",spacing:1,children:[Object(y.jsx)(j.Icons.Check,{}),Object(y.jsx)(j.Body1,{children:t})]})};return Object(y.jsxs)(j.Stack,{spacing:2,sx:{marginTop:{xs:e.spacing(4),sm:e.spacing(3)},backgroundColor:h.colours.eagleTealBackground,padding:e.spacing(2),borderRadius:e.spacing(1)},children:[Object(y.jsx)(g.a,{}
1),Object(y.jsx)(j.H6,{bold:!0,style:{marginTop:e.spacing(2)},children:"Countingup Web is in Beta. We\u2019re still adding features, so you won\u2019t be able to do everything you can on the Countingup app. Here\u2019s what you can do right now:"}),Object(y.jsxs)(j.Stack,{spacing:2,children:[Object(y.jsx)(t,{body:"View your transactions"}),Object(y.jsx)(t,{body:"View notes and attachments"})]})]})},w=function(e){var t=e.login,n=Object(O.a)(),a=Object(p.a)().xs,r=Object(c.useState)(""),i=Object(l.a)(r,2),d=i[0],g=i[1],x=Object(c.useState)(!1),f=Object(l.a)(x,2),m=f[0],w=f[1],C=Object(c.useState)(),B=Object(l.a)(C,2),T=B[0],S=B[1],E=Object(c.useCallback)(Object(s.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return S(void 0),w(!0),e.prev=2,e.next=5,t(d);case 5:e.next=12;break;case 7:e.prev=7,e.t0=e.catch(2),console.error(e.t0),b.c.isSwaggerException(e.t0)&&404===e.t0.status&&S("An error occurred during login. Please try again."),w(!1);case 12:case"end":return e.stop()}}),e,null,[[2,7]])}))),[t,d]),L=Object(u.b)(d)&&!m;return Object(y.jsxs)(k,{children:[Object(y.jsxs)(j.H2,{children:["Log in to Countingup Web ",Object(y.jsx)("span",{style:{color:h.colours.eagleTeal},children:"Beta"})]}),Object(y.jsx)(j.Body1,{style:{paddingTop:n.spacing(2)},children:"Enter the email address you use to log into the Countingup app. Have your Countingup app ready to verify your login."}),Object(y.jsxs)("form",{"data-testid":"form",onSubmit:function(e){e.preventDefault(),L&&E()},style:{paddingTop:n.spacing(3)},children:[Object(y.jsx)(j.TextField,{value:d,onChange:function(e){return g(e.target.value)},validationMessage:"Please enter a valid email address",validator:u.b,placeholder:"Email address",label:"Email address"}),Object(y.jsx)(j.Button,{variant:"contained",sx:{mt:1},fullWidth:a,disabled:!L,onClick:E,children:"Log in"}),T&&Object(y.jsx)(j.Body2,{style:{color:h.colours.jellyRed},children:T})]}),Object(y.jsx)(j.Body1,{style:{paddingTop:n.spacing(3)},children:"Don\u2019t have an account yet? Signup in minutes with the Countingup app"}),Object(y.jsx)(j.Link,{style:{marginTop:n.spacing(1)},children:"Get the app"}),Object(y.jsx)(v,{})]})},C=function(){var e=Object(x.c)(),t=Object(a.h)();Object(c.useEffect)((function(){Object(d.a)()?t.replace(r.a.signingIn.path()):Object(d.o)()&&t.replace(r.a.code.path())}));var n=function(){var n=Object(s.a)(o.a.mark((function n(c){var a,i,s,l,j;return o.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return Object(d.b)(),n.next=3,Object(d.c)();case 3:return i=n.sent,s=Object(d.j)(),n.next=7,e.requestAuthorization("code",s,"","","",i);case 7:return l=n.sent,Object(d.m)(l),Object(d.l)(c),n.next=12,e.webLogin({email:c,loginID:l});case 12:j=n.sent,Object(d.n)(null!==(a=j.otp)&&void 0!==a?a:""),t.push(r.a.code.path());case 15:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}();return Object(y.jsx)(w,{login:n})},B=function(e,t){Object(c.useEffect)((function(){var n,c=function(){var a=Object(s.a)(o.a.mark((function a(){return o.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,e();case 2:if(a.sent){a.next=5;break}return a.abrupt("return");case 5:n=window.setTimeout(c,t);case 6:case"end":return a.stop()}}),a)})));return function(){return a.apply(this,arguments)}}();return n=window.setTimeout(c,t),function(){window.clearTimeout(n)}}),[e,t])},T=n(5),S=n(595),E=Object(T.a)("div")((function(e){var t=e.theme;return{display:"flex",justifyContent:"center",padding:"".concat(t.spacing(2)," ").concat(t.spacing(3)),backgroundColor:h.colours.eagleTealBackground,borderRadius:t.spacing(1)}})),L=function(e){var t=e.code;return Object(y.jsx)(E,{children:Object(y.jsx)(j.H1,{children:t})})},I=function(e){return Object(y.jsx)(S.a,{"aria-label":"breadcrumb",children:Object(y.jsxs)(j.Link,{role:"link",onClick:e.onClick,children:[Object(y.jsx)(j.Icons.ChevronThinLeft,{fill:h.colours.jellyRed}),Object(y.jsx)(j.Body1,{bold:!0,style:{color:h.colours.jellyRed},children:"Back"})]})})},A=function(e){var t=e.code,n=e.email,c=e.onBack,a=Object(O.a)();return Object(y.jsx)(k,{children:Object(y.jsxs)(j.Grid,{container:!0,children:[Object(y.jsxs)(j.Grid,{item:!0,xs:4,sm:8,md:12,children:[Object(y.jsx)(I,{onClick:c}),Object(y.jsx)(j.H3,{style:{paddingTop:a.spacing(2)},children:"Enter this code on the Countingup app"}),Object(y.jsxs)(j.Body1,{style:{paddingTop:a.spacing(2)}
1,children:["Open the Countingup app logged in to the account ",Object(y.jsx)(j.Body1Span,{bold:!0,children:n})," to continue."]})]}),Object(y.jsx)(j.Grid,{item:!0,xs:4,sm:8,md:7,lg:6,children:Object(y.jsx)(L,{code:t})}),Object(y.jsx)(j.Grid,{item:!0,xs:4,sm:8,md:12,children:Object(y.jsxs)(j.Body1,{style:{display:"flex"},children:["Can\u2019t enter the code?"," ",Object(y.jsx)(j.Link,{href:"mailto:[email protected]",style:{paddingLeft:a.spacing(1)},children:"Contact support"})]})})]})})},D=function(e){var t=e.code,n=e.email,a=e.isLoginExpired,r=e.loginID,i=e.onApproved,l=e.onDeclined,j=e.onTimeout,u=e.onError,d=e.onBack,p=Object(x.c)(),O=Object(c.useCallback)(Object(s.a)(o.a.mark((function e(){var t;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a()){e.next=3;break}return j(),e.abrupt("return",!1);case 3:return e.prev=3,e.next=6,p.checkAuthorized({loginID:r});case 6:return t=e.sent,i(t.code,t.state),e.abrupt("return",!1);case 11:if(e.prev=11,e.t0=e.catch(3),!b.c.isSwaggerException(e.t0)){e.next=17;break}return e.abrupt("return",G(e.t0,l,j,u));case 17:return u(e.t0),e.abrupt("return",!1);case 19:case"end":return e.stop()}}),e,null,[[3,11]])}))),[p,a,r,i,l,j,u]);return B(O,3e3),Object(y.jsx)(A,{code:t,email:n,onBack:d})},G=function(e,t,n,c){if(202===e.status)return!0;switch(e.status){case 401:t();break;case 403:n();break;case 404:c(e);break;default:c(e)}return!1},H=function(){var e=Object(a.h)(),t=Object(d.g)(),n=Object(d.e)(),i=Object(d.f)();Object(c.useEffect)((function(){Object(d.a)()?e.replace(r.a.signingIn.path()):Object(d.o)()||e.replace(r.a.login.path())}),[e,t,i]);var o=Object(c.useCallback)((function(t,n){console.log("State:",n),Object(d.k)(t),e.replace(r.a.signingIn.path())}),[e]),s=Object(c.useCallback)((function(){Object(d.b)(),e.replace(r.a.error.path())}),[e]),l=Object(c.useCallback)((function(){Object(d.b)(),e.replace(r.a.timeout.path())}),[e]),j=Object(c.useCallback)((function(){Object(d.b)(),e.replace(r.a.login.path())}),[e]),u=Object(c.useCallback)((function(t){console.error(t),e.replace(r.a.error.path())}),[e]);return t&&i&&!Object(d.i)()&&n?t&&i&&n?Object(y.jsx)(D,{isLoginExpired:d.i,code:t,email:n,loginID:i,onApproved:o,onDeclined:s,onTimeout:l,onError:u,onBack:j}):null:(Object(d.b)(),Object(y.jsx)(a.a,{to:r.a.login.path()}))},R=n(1205),_=n(1175),W=n(1298),z=function(){var e=Object(a.h)(),t=Object(x.c)();return Object(c.useEffect)((function(){Object(s.a)(o.a.mark((function n(){var c,a,i;return o.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(c=Object(d.d)(),a=Object(d.h)(),c&&a&&!Object(d.i)()){n.next=5;break}return e.replace(r.a.login.path()),n.abrupt("return");case 5:return n.next=7,t.oauthTokenExchange(b.b.Authorization_code,c,void 0,Object(d.j)(),a);case 7:i=n.sent,Object(R.k)(i.user_id,i.access_token,i.expires_in,i.refresh_token),e.replace(_.a.home.path());case 10:case"end":return n.stop()}}),n)})))()}),[t,e]),Object(d.a)()?Object(y.jsx)(W.b,{}):null},J=n(134),M=new b.a(J.a,{fetch:window.fetch.bind(window)}),P=function(e){var t=e.children;return Object(y.jsx)(x.a,{value:{isSample:!1,clients:{auth:M}},children:t})},V=n(3),Y=function(e){return Object(y.jsx)(F,Object(V.a)(Object(V.a)({},e),{},{title:"Something went wrong"}))},q=function(e){return Object(y.jsx)(F,Object(V.a)(Object(V.a)({},e),{},{title:"Login attempt timed out"}))},F=function(e){var t=e.tryAgain,n=e.title;return Object(y.jsx)(k,{children:Object(y.jsxs)(j.Stack,{spacing:2,alignItems:{sm:"flex-start"},children:[Object(y.jsx)(j.H3,{children:n}),Object(y.jsx)(j.Body1,{children:"Click the button below to try again"}),Object(y.jsx)(j.Stack,{py:1,children:Object(y.jsx)(j.Button,{variant:"contained",onClick:t,children:"Try again"})}),Object(y.jsxs)(j.Body1,{children:["Struggling to login?",Object(y.jsx)(j.Link,{href:"mailto:[email protected]",sx:{paddingLeft:1},style:{display:"inline"},children:"Contact support"})]})]})})},K=function(e){var t=e.tryAgain;return Object(y.jsx)(k,{children:Object(y.jsxs)(j.Stack,{spacing:2,alignItems:{sm:"flex-start"},children:[Object(y.jsx)(j.H3,{children:"You\u2019ve been logged out"}),Object(y.jsx)(j.Body1,{children:"You haven\u2019t done anything for a while so we logged you out."}),Object(y.jsx)(j.Stack,{py:1,children:Object(y.jsx)(j.Button,{variant:"contained",onClick:t,children:"Log back in"})})]})})};t.default=function(){var e=Object(a.h)(),t=function(){return e.replace(r.a.login.path())};return Object(y.jsx)(P,{children:Object(y.jsxs)(a.d,{children:[Object(y.jsx)(a.b,{exact:!0,path:r.a.login.template,children:Object(y.jsx)(C,{})}
1),Object(y.jsx)(a.b,{exact:!0,path:r.a.code.template,children:Object(y.jsx)(H,{})}),Object(y.jsx)(a.b,{exact:!0,path:r.a.signingIn.template,children:Object(y.jsx)(z,{})}),Object(y.jsx)(a.b,{exact:!0,path:r.a.error.template,children:Object(y.jsx)(Y,{tryAgain:t})}),Object(y.jsx)(a.b,{exact:!0,path:r.a.timeout.template,children:Object(y.jsx)(q,{tryAgain:t})}),Object(y.jsx)(a.b,{exact:!0,path:r.a.loggedOut.template,children:Object(y.jsx)(K,{tryAgain:t})})]})})}}}]);
2//# sourceMappingURL=web_login.7c8fe2f5.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.