PageSourceSearch

https://www.trustugc.com/_next/static/chunks/app/(app)/app/(auth)/login/page-3dd307ef250707a9.js

js trustugc.com collected 2026-10-04 21:14:34 UTC 4,866 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4887],{91562:function(e,t,n){Promise.resolve().then(n.bind(n,33378))},43200:function(e,t,n){"use strict";n.d(t,{AZ:function(){return h},II:function(){return d},Mm:function(){return l},P0:function(){return f},Wk:function(){return m}});var r=n(45008),a=n(93954);function i(){let e=(0,r._)(["\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  color: white;\n  font-weight: 500;\n  border-radius: 5px;\n  width: 100%;\n\n  &:disabled {\n    opacity: 0.5;\n  }\n"]);return i=function(){return e},e}function s(){let e=(0,r._)(["\n  width: 100%;\n  border: 1px solid rgb(0, 0, 0, 0.1);\n  border-radius: 5px;\n  padding: 5px 10px;\n  outline: none;\n  transition: all 0.2s;\n  font-size: 0.9rem;\n"]);return s=function(){return e},e}function o(){let e=(0,r._)(["\n  font-weight: 500;\n"]);return o=function(){return e},e}function c(){let e=(0,r._)(["\n  width: 100%;\n  max-width: 550px;\n  margin: 0 auto;\n"]);return c=function(){return e},e}function u(){let e=(0,r._)(["\n  width: 100%;\n  height: calc(100% - 50%);\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  min-height: 500px;\n"]);return u=function(){return e},e}let l=a.ZP.button(i()),d=a.ZP.input(s()),h=a.ZP.label(o()),f=a.ZP.div(c()),m=a.ZP.div(u())},33378:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var r=n(57437),a=n(2265),i=n(76896),s=n(43200),o=n(27648),c=n(45933),u=n(83871),l=n(15863);function d(){let e=(0,a.useRef)(),t=(0,a.useRef)(),[n,d]=(0,a.useState)(),[h,f]=(0,a.useState)(!1);async function m(n){if(n.preventDefault(),h)return;f(!0),d();let r=e.current&&e.current.value,a=t.current&&t.current.value,{error:s}=await i.Z.signIn(r,a);if(s)return f(!1),d(s)}async function p(){if(!h){f(!0),d();try{await i.Z.signInWithGoogle()}catch(e){d(e.message)}finally{f(!1)}}}return(0,r.jsx)(s.Wk,{children:(0,r.jsxs)(s.P0,{children:[(0,r.jsxs)("form",{onSubmit:m,children:[(0,r.jsx)("h1",{className:"text-2xl font-medium mb-10",children:"Welcome back"}),(0,r.jsx)(s.AZ,{children:"Email"}),(0,r.jsx)(s.II,{ref:e,placeholder:"Enter your email...",type:"email",className:"mt-2 mb-6",required:!0}),(0,r.jsx)(s.AZ,{children:"Password"}),(0,r.jsx)(s.II,{ref:t,className:"mt-2",placeholder:"Enter your password...",type:"password",required:!0}),(0,r.jsx)("div",{className:"mt-3 text-sm",children:(0,r.jsx)(o.default,{className:"underline text-brand",href:"/app/login/reset-password",children:"Forgot your password?"})}),n&&(0,r.jsxs)("div",{className:"mt-8 mb-3 text-red-500",children:["Error: ",n]}),(0,r.jsx)(s.Mm,{disabled:h,className:"mt-6 bg-brand gap-3",type:"submit",children:h?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.Z,{className:"animate-spin w-4 h-4"})," Loading..."]}):"Sign in"}),(0,r.jsxs)(c.z,{type:"button",onClick:p,variant:"outline",className:"mt-4 mx-auto w-full shadow-sm flex items-center gap-8",children:[(0,r.jsx)(u.JM8,{size:23}),"Sign in with Google"]})]}),(0,r.jsxs)("div",{className:"mt-10",children:["Don't have an account?"," ",(0,r.jsx)(o.default,{className:"underline text-brand",href:"/app/signup",children:"Create an account."})]})]})})}},76896:function(e,t,n){"use strict";var r=n(44752),a=n(24899),i=n(5260),s=n(28171),o=n(2003),c=n(35669);class u{static async signIn(e,t){let n,i;try{(n=await (0,r.e5)(a.Z.auth(),e,t)).user&&c.Z.ga4({event:"login"})}catch(e){i="Invalid email or password."}return{result:n,error:i}}static async signUp(e){let{email:t,password:n,firstName:u,lastName:l="",hasAccount:d=!1}=e;try{d||await (0,r.Xb)(a.Z.auth(),t,n);let e=await (0,i.ZP)("POST","api/user/signup",!0,{firstName:u,lastName:l});if(!e)throw Error("Unable to connect to server");if(e.error)throw Error(e.error);let{reviews:h,...f}=e.user;s.h.dispatch((0,o.av)(f)),c.Z.ga4({event:"sign_up",parameters:{method:d?"Google":"Email"}})}catch(e){switch(e.code){case r.kq.EMAIL_EXISTS:throw Error("There is already an existing account under that email");case r.kq.WEAK_PASSWORD:throw Error("The password must be 6 characters long or more");default:throw Error(e.message)}}}static async signInWithGoogle(){try{let e=await (0,r.rh)(a.Z.auth(),new r.hJ),{isNewUser:t}=(0,r.gK)(e);if(t){let[t,n]=e.user.displayName.split(" ");await this.signUp({firstName:t,lastName:n,hasAccount:!0})}else c.Z.ga4({event:"login",parameters:{method:"Google"}})}catch(e){switch(e.code){case r.kq.POPUP_BLOCKED:throw Error("Popups are blocked");case r.kq.POPUP_CLOSED_BY_USER:throw Error("Authorization canceled by user");default:throw Error(e.message)}}}static async generatePaymentLink(){let e=await (0,i.ZP)("POST","api/stripe/checkout",!0);if(!e)throw Error("Unable to connect to server");if(e.error)throw Error(e.error);return e.redirect}}t.Z=u}}
1,function(e){e.O(0,[4358,3153,3082,2972,7209,5797,2773,3954,575,8034,2971,2117,1744],function(){return e(e.s=91562)}),_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.